Software Engineering & Information Systems DesignSoftware Engineering & Information Systems Design

How we build software step by step: process models, requirements, UML, testing, architecture, and system design basics.ধাপে ধাপে software বানানোর নিয়ম: process model, requirements, UML, testing, architecture আর system design-এর basic।

1. Software Lifecycle & Process Models1. Software Lifecycle & Process Models

Software is not built in one shot. It goes through a lifecycle: a series of phases from the first idea to the final retirement of the product. This is called the SDLC (Software Development Life Cycle).

The standard SDLC phases are:

  1. Requirements analysis — find out WHAT the customer needs.
  2. Design — plan HOW the software will be built (architecture, modules, data).
  3. Implementation (coding) — write the actual code.
  4. Testing — check that the software works and matches the requirements.
  5. Deployment — deliver the software to the users.
  6. Maintenance — fix bugs and add changes after release. This is often the longest and most costly phase.

A process model is a plan that says in which order and in what style we do these phases. Different projects need different models.

Software একবারে বানানো হয় না। এটা একটা lifecycle-এর মধ্যে দিয়ে যায়: প্রথম idea থেকে শুরু করে product বাতিল হওয়া পর্যন্ত কিছু ধাপ। এটাকেই বলে SDLC (Software Development Life Cycle)

Standard SDLC phase গুলো হলো:

  1. Requirements analysis — customer আসলে কী চায়, সেটা বের করা।
  2. Design — software কীভাবে বানানো হবে তার plan (architecture, module, data)।
  3. Implementation (coding) — আসল code লেখা।
  4. Testing — software ঠিকমতো কাজ করে কি না আর requirement মেলে কি না, তা check করা।
  5. Deployment — user-দের কাছে software পৌঁছে দেওয়া।
  6. Maintenance — release-এর পরে bug fix আর নতুন change যোগ করা। এটা প্রায়ই সবচেয়ে লম্বা আর সবচেয়ে বেশি খরচের phase।

Process model হলো একটা plan, যেটা বলে দেয় এই phase গুলো কোন order-এ, কোন style-এ করা হবে। আলাদা আলাদা project-এর জন্য আলাদা model লাগে।

Waterfall modelWaterfall model

The Waterfall model is the oldest and simplest model. Phases run one after another, like water falling down steps. You finish one phase completely, get it approved, then move to the next. Going back is very hard.

Waterfall model হলো সবচেয়ে পুরনো আর সবচেয়ে simple model। Phase গুলো একটার পর একটা চলে, সিঁড়ি দিয়ে পানি পড়ার মতো। একটা phase পুরো শেষ করে approve করিয়ে তারপর পরের phase-এ যাওয়া হয়। পেছনে ফেরা খুব কঠিন।

Requirements Design Implementation Testing Deployment + Maintenance
Waterfall model: each phase flows down to the next, no going back.Waterfall model: প্রতিটা phase নিচের phase-এ নামে, পেছনে ফেরা নেই।

Pros:

  • Very simple to understand and manage.
  • Each phase has a clear output (document, code, test report).
  • Works well when requirements are fixed and well understood.

Cons:

  • Working software appears only at the very end.
  • Very hard to handle changing requirements.
  • A mistake found late (in testing) is very costly to fix.
  • Customer sees the product only at the end — big risk of "this is not what I wanted".

Pros:

  • বোঝা আর manage করা খুব সহজ।
  • প্রতিটা phase-এর একটা clear output থাকে (document, code, test report)।
  • Requirement fixed আর ভালোভাবে জানা থাকলে ভালো কাজ করে।

Cons:

  • কাজ করা software একদম শেষে পাওয়া যায়।
  • Requirement বদলালে সামলানো খুব কঠিন।
  • দেরিতে (testing-এ) ভুল ধরা পড়লে ঠিক করতে অনেক খরচ হয়।
  • Customer product দেখে একদম শেষে — "আমি তো এটা চাইনি" হওয়ার বড় risk।

V-modelV-model

The V-model is Waterfall bent into a V shape. Each development phase on the left side has a matching testing phase on the right side. Test plans are written EARLY, while the matching left-side phase is running.

  • Requirements ↔ Acceptance testing
  • System design ↔ System testing
  • Module (detailed) design ↔ Integration testing
  • Coding ↔ Unit testing

Good for safety-critical projects (medical, avionics) where testing must be planned very carefully. Same weakness as Waterfall: rigid, bad with changes.

V-model হলো Waterfall-কে V আকারে ভাঁজ করা। বাম পাশের প্রতিটা development phase-এর সাথে ডান পাশে একটা matching testing phase থাকে। Test plan আগেভাগেই লেখা হয়, যখন বাম পাশের phase চলছে।

  • Requirements ↔ Acceptance testing
  • System design ↔ System testing
  • Module (detailed) design ↔ Integration testing
  • Coding ↔ Unit testing

Safety-critical project-এর জন্য ভালো (medical, avionics), যেখানে testing খুব যত্ন করে plan করতে হয়। দুর্বলতা Waterfall-এর মতোই: rigid, change সামলাতে পারে না।

Incremental modelIncremental model

In the Incremental model, the product is built and delivered in pieces called increments. The first increment is usually the core product (most important features). Each new increment adds more features on top.

Customer gets working software early, and feedback from one increment improves the next. Needs good planning so the pieces fit together.

Incremental model-এ product ছোট ছোট টুকরোয় বানিয়ে deliver করা হয়, প্রতিটা টুকরোকে বলে increment। প্রথম increment সাধারণত core product (সবচেয়ে জরুরি feature গুলো)। প্রতিটা নতুন increment তার উপরে আরও feature যোগ করে।

Customer আগেভাগে কাজ করা software পায়, আর এক increment-এর feedback পরের increment-কে ভালো করে। টুকরোগুলো যেন ঠিকমতো জোড়া লাগে, তার জন্য ভালো planning লাগে।

Spiral model (risk-driven)Spiral model (risk-driven)

The Spiral model (by Barry Boehm) combines iteration with risk analysis. The project moves in loops (spirals). Each loop has 4 quadrants:

  1. Determine objectives — set goals and constraints for this loop.
  2. Risk analysis — find risks, analyze them, build prototypes to reduce them.
  3. Develop and test — build the next version of the product.
  4. Plan next iteration — review with customer and plan the next loop.

Its key word is risk-driven: before every loop, the biggest risks are attacked first. Good for large, expensive, high-risk projects. Downside: costly, needs risk experts, too heavy for small projects.

Spiral model (Barry Boehm-এর দেওয়া) iteration-এর সাথে risk analysis মেলায়। Project টা loop (spiral) আকারে এগোয়। প্রতিটা loop-এ ৪টা quadrant থাকে:

  1. Determine objectives — এই loop-এর goal আর constraint ঠিক করা।
  2. Risk analysis — risk খুঁজে বের করা, analyze করা, risk কমাতে prototype বানানো।
  3. Develop and test — product-এর পরের version বানানো।
  4. Plan next iteration — customer-এর সাথে review করে পরের loop-এর plan করা।

এর মূল কথা risk-driven: প্রতিটা loop-এর আগে সবচেয়ে বড় risk গুলো আগে ধরা হয়। বড়, দামি, high-risk project-এর জন্য ভালো। খারাপ দিক: খরচ বেশি, risk expert লাগে, ছোট project-এর জন্য অতিরিক্ত ভারী।

1. Determine objectives 2. Risk analysis 3. Develop & test 4. Plan next loop start each loop = one version, radius = cost so far
Spiral model: 4 quadrants per loop; each loop starts with risk analysis, radius grows with total cost.Spiral model: প্রতিটা loop-এ ৪টা quadrant; প্রতিটা loop risk analysis দিয়ে শুরু হয়, radius মানে এখন পর্যন্ত মোট খরচ।

Prototyping modelPrototyping model

When the customer is not sure what they want, we build a quick, rough prototype (often just the UI, with fake logic). The customer plays with it and gives feedback. We refine or rebuild until requirements become clear, then build the real system.

  • Throwaway prototype: the prototype is discarded; only the learned requirements are kept.
  • Evolutionary prototype: the prototype slowly grows into the final system.

Risk: the customer may think the rough prototype is the real product and expect delivery too soon.

Customer নিজেই যখন sure না সে কী চায়, তখন আমরা তাড়াতাড়ি একটা মোটামুটি prototype বানাই (অনেক সময় শুধু UI, ভেতরে fake logic)। Customer সেটা ব্যবহার করে feedback দেয়। Requirement clear না হওয়া পর্যন্ত ঠিক করতে থাকি, তারপর আসল system বানাই।

  • Throwaway prototype: prototype ফেলে দেওয়া হয়; শুধু শেখা requirement গুলো রাখা হয়।
  • Evolutionary prototype: prototype ধীরে ধীরে final system-এ বদলে যায়।

Risk: customer ভাবতে পারে মোটামুটি prototype-টাই আসল product, আর খুব তাড়াতাড়ি delivery আশা করতে পারে।

Agile & ScrumAgile & Scrum

Agile is a family of methods based on the Agile Manifesto (2001). Core ideas: deliver working software in short cycles, welcome changing requirements, talk to the customer all the time, prefer people and working software over heavy documents and rigid plans.

Scrum is the most popular Agile framework. Work happens in fixed short cycles called sprints (usually 2–4 weeks). Each sprint ends with a potentially shippable product increment.

Scrum roles (only 3):

  • Product Owner — owns the product backlog, decides WHAT to build and in what priority.
  • Scrum Master — coach and protector of the process; removes blockers. NOT a boss/manager.
  • Development Team — 3–9 people who actually build the product; self-organizing.

Scrum artifacts: Product Backlog (all wanted features, prioritized), Sprint Backlog (items chosen for this sprint), Increment (working product at sprint end).

Scrum events: Sprint Planning, Daily Scrum (15-minute stand-up), Sprint Review (demo to stakeholders), Sprint Retrospective (how can WE work better).

XP (Extreme Programming) is another Agile method focused on engineering practices: pair programming, test-driven development (write tests first), continuous integration, small frequent releases, refactoring.

Agile হলো Agile Manifesto (2001)-এর উপর দাঁড়ানো কিছু method-এর পরিবার। মূল কথা: ছোট ছোট cycle-এ কাজ করা software deliver করা, requirement বদলালে স্বাগত জানানো, customer-এর সাথে সবসময় কথা বলা, ভারী document আর rigid plan-এর চেয়ে মানুষ আর কাজ করা software-কে বেশি দাম দেওয়া।

Scrum হলো সবচেয়ে জনপ্রিয় Agile framework। কাজ হয় fixed ছোট cycle-এ, যাকে বলে sprint (সাধারণত ২–৪ সপ্তাহ)। প্রতিটা sprint শেষে একটা shippable product increment পাওয়া যায়।

Scrum role (মাত্র ৩টা):

  • Product Owner — product backlog-এর মালিক, ঠিক করে কী বানানো হবে আর কোনটা আগে।
  • Scrum Master — process-এর coach আর রক্ষক; blocker সরায়। কোনো boss/manager না।
  • Development Team — ৩–৯ জন, যারা আসলে product বানায়; self-organizing।

Scrum artifact: Product Backlog (সব চাওয়া feature, priority অনুযায়ী সাজানো), Sprint Backlog (এই sprint-এর জন্য বাছাই করা item), Increment (sprint শেষের কাজ করা product)।

Scrum event: Sprint Planning, Daily Scrum (১৫ মিনিটের stand-up), Sprint Review (stakeholder-দের demo), Sprint Retrospective (আমরা কীভাবে আরও ভালো কাজ করতে পারি)।

XP (Extreme Programming) আরেকটা Agile method, engineering practice-এ focus করে: pair programming, test-driven development (আগে test লেখা), continuous integration, ছোট ছোট ঘন ঘন release, refactoring।

Exam tip: Scrum roles come up a lot. Remember: Product Owner = WHAT (priorities), Scrum Master = PROCESS (not a manager), Team = HOW. Sprint = 2–4 weeks, Daily Scrum = 15 minutes. "Project Manager" is NOT a Scrum role — a classic trick option.
Exam tip: Scrum role নিয়ে প্রশ্ন খুব আসে। মনে রাখো: Product Owner = কী বানাবে (priority), Scrum Master = process (manager না), Team = কীভাবে বানাবে। Sprint = ২–৪ সপ্তাহ, Daily Scrum = ১৫ মিনিট। "Project Manager" কোনো Scrum role না — এটা classic trick option।

Comparison of process modelsProcess model-দের comparison

ModelModel StyleStyle Handles change?Change সামলায়? Working software when?কাজ করা software কখন? Best forকার জন্য ভালো
Waterfall Linear, one passLinear, এক pass Very poorlyখুব খারাপভাবে Only at the endএকদম শেষে Small projects, fixed clear requirementsছোট project, fixed আর clear requirement
V-model Linear + matched testingLinear + matched testing Poorlyখারাপভাবে At the endশেষে Safety-critical systems needing strong testingSafety-critical system, যেখানে কড়া testing দরকার
Incremental Pieces (increments)টুকরো (increment) Moderatelyমোটামুটি Early (first increment)আগেভাগে (প্রথম increment) Core features needed fast, full team not availableCore feature দ্রুত দরকার, পুরো team নেই
Spiral Iterative + risk analysisIterative + risk analysis Wellভালোভাবে Each loop gives a versionপ্রতিটা loop-এ একটা version Large, expensive, high-risk projectsবড়, দামি, high-risk project
Prototyping Build rough → feedback → refineমোটামুটি বানাও → feedback → ঠিক করো Well (early)ভালোভাবে (শুরুতে) Prototype very earlyPrototype খুব আগে Unclear/uncertain requirementsRequirement অস্পষ্ট হলে
Agile / Scrum Short sprints, continuous feedbackছোট sprint, continuous feedback Very wellখুব ভালোভাবে Every sprint (2–4 weeks)প্রতি sprint-এ (২–৪ সপ্তাহ) Changing requirements, close customer contactRequirement বদলায়, customer কাছে থাকে
Example (choose the model): A bank asks for software where requirements are legally fixed and documented — choose Waterfall/V-model. A startup wants an app but the founder keeps changing his mind — choose Agile (Scrum) or Prototyping. A defense project worth millions with new untested technology — choose Spiral, because risk must be analyzed each loop.
Example (model বাছাই): Bank এমন software চায় যেখানে requirement আইনগতভাবে fixed আর documented — Waterfall/V-model নাও। Startup একটা app চায় কিন্তু founder বারবার মত বদলায় — Agile (Scrum) বা Prototyping নাও। কোটি টাকার defense project, নতুন untested technology — Spiral নাও, কারণ প্রতি loop-এ risk analyze করতে হবে।
BUET favorite: "Which process model would you choose for scenario X, and why?" Always name the model, then give 2–3 reasons tied to the scenario (requirement stability, risk level, delivery speed, customer availability).
BUET favorite: "Scenario X-এর জন্য কোন process model নেবে, কেন?" সবসময় আগে model-এর নাম বলো, তারপর scenario-র সাথে মিলিয়ে ২–৩টা কারণ দাও (requirement কতটা stable, risk কেমন, delivery কত দ্রুত লাগবে, customer কতটা available)।

Why Software Projects Fail (Real Exam Question!)Software Project কেন Fail করে (Real Exam Question!)

Many software projects finish late, cost too much, or get cancelled. In the exam, you should be able to LIST the main reasons and say one line about each:

  • Unclear or changing requirements — the team never really knew what to build, or the target kept moving.
  • Poor estimation of time and cost — the schedule and budget were guesses that were too optimistic.
  • Lack of user involvement — users were not asked during development, so the final product did not fit their real work.
  • Poor communication — team members, managers, and the customer did not share the same understanding.
  • Inadequate testing — bugs reached the users because testing was rushed or skipped.
  • Scope creep — new features kept getting added without adding time or people.
  • Weak project management — no clear plan, no progress tracking, wrong people on wrong tasks.
  • Technical debt — quick-and-dirty code piled up until every new change became slow and risky.
  • No risk management — nobody asked "what can go wrong?" early, so problems arrived as surprises.

অনেক software project দেরিতে শেষ হয়, খরচ বেশি হয়ে যায়, বা বাতিল হয়। Exam-এ মূল কারণগুলো LIST করে প্রতিটা নিয়ে এক লাইন বলতে পারতে হবে:

  • Unclear বা changing requirements — team আসলে জানতই না কী বানাতে হবে, বা target বারবার সরে গেছে।
  • Time আর cost-এর poor estimation — schedule আর budget ছিল বেশি আশাবাদী আন্দাজ।
  • User involvement-এর অভাব — development-এর সময় user-দের জিজ্ঞেস করা হয়নি, তাই final product তাদের আসল কাজের সাথে মেলেনি।
  • Poor communication — team member, manager আর customer একই জিনিস বোঝেনি।
  • Inadequate testing — testing তাড়াহুড়ায় বা বাদ পড়ায় bug user-দের কাছে পৌঁছে গেছে।
  • Scope creep — সময় বা মানুষ না বাড়িয়েই নতুন নতুন feature যোগ হতে থেকেছে।
  • Weak project management — clear plan নেই, progress track হয় না, ভুল মানুষ ভুল কাজে।
  • Technical debt — তাড়াহুড়ার নোংরা code জমতে জমতে প্রতিটা নতুন change slow আর risky হয়ে গেছে।
  • Risk management নেই — শুরুতে কেউ জিজ্ঞেস করেনি "কী কী ভুল হতে পারে?", তাই সমস্যাগুলো surprise হয়ে এসেছে।
Real BUET question (April 2024): "Mention the reasons for the failure of a software project." A list like the one above, with one-line explanations, is exactly what earns the marks. Try to give at least 5–6 reasons.
Real BUET question (April 2024): "Mention the reasons for the failure of a software project." উপরের মতো list, প্রতিটার সাথে এক লাইনের ব্যাখ্যা — এটাই নম্বর তোলে। অন্তত ৫–৬টা কারণ দেওয়ার চেষ্টা করো।

Software Maintenance and the SMLCSoftware Maintenance আর SMLC

Maintenance is everything done to the software AFTER delivery. It is usually the longest and most expensive part of the lifecycle (often 60% or more of total cost). There are four types of maintenance:

  • Corrective — fix bugs that users find after release. (Reactive: something is broken.)
  • Adaptive — change the software so it keeps working in a NEW environment: new OS, new hardware, new database, new law or tax rule.
  • Perfective — improve the software for users: add requested features, make it faster, make reports nicer.
  • Preventive — clean up NOW to avoid problems LATER: restructure messy code, update documentation, remove dead code.

The SMLC (Software Maintenance Life Cycle) has six phases, in order:

  1. Identification — receive change requests and identify what kind of modification is needed.
  2. Analysis — study the feasibility, impact, and cost of the change.
  3. Design — design the modification using the current system's documents and structure.
  4. Implementation — actually code the change into the system.
  5. System testing — test the changed module, its integration, and run regression tests so old features still work.
  6. Delivery — release the updated software to users (with updated manuals/training if needed).

Maintenance হলো delivery-র PORE software-এ করা সব কাজ। এটা সাধারণত lifecycle-এর সবচেয়ে লম্বা আর সবচেয়ে খরচের অংশ (মোট খরচের প্রায়ই 60% বা তার বেশি)। Maintenance-এর চারটা type:

  • Corrective — release-এর পরে user-দের পাওয়া bug ঠিক করা। (Reactive: কিছু একটা ভেঙে আছে।)
  • Adaptive — নতুন environment-এ software চালু রাখার জন্য বদলানো: নতুন OS, নতুন hardware, নতুন database, নতুন আইন বা tax-এর নিয়ম।
  • Perfective — user-দের জন্য software ভালো করা: চাওয়া feature যোগ করা, আরও fast করা, report সুন্দর করা।
  • Preventive — পরের সমস্যা এড়াতে এখনই পরিষ্কার করা: এলোমেলো code restructure করা, documentation update করা, dead code সরানো।

SMLC (Software Maintenance Life Cycle)-এর ছয়টা phase, order অনুযায়ী:

  1. Identification — change request নেওয়া আর কী ধরনের modification লাগবে তা identify করা।
  2. Analysis — change-টার feasibility, impact আর cost study করা।
  3. Design — চালু system-এর document আর structure দেখে modification-টা design করা।
  4. Implementation — change-টা আসলেই system-এ code করা।
  5. System testing — বদলানো module, তার integration test করা, আর পুরনো feature ঠিক আছে কি না দেখতে regression test চালানো।
  6. Delivery — updated software user-দের কাছে release করা (দরকার হলে updated manual/training সহ)।
Example (name the type): (1) "Login crashes when the password has an emoji" → corrective. (2) "VAT changed from 15% to 12.5%, update the billing" → adaptive (external rule changed). (3) "Users want a dark mode" → perfective. (4) "Refactor the payment module before it becomes unmaintainable" → preventive.
Example (type চেনো): (1) "Password-এ emoji থাকলে login crash করে" → corrective। (2) "VAT 15% থেকে 12.5% হয়েছে, billing update করো" → adaptive (বাইরের নিয়ম বদলেছে)। (3) "User-রা dark mode চায়" → perfective। (4) "Payment module unmaintainable হওয়ার আগে refactor করো" → preventive
Real BUET question (April 2019): "What are the six phases of the Software Maintenance Life Cycle?" Memorize the order: Identification → Analysis → Design → Implementation → System testing → Delivery. Also be ready to define the four maintenance types with one example each.
Real BUET question (April 2019): "Software Maintenance Life Cycle-এর ছয়টা phase কী কী?" Order-টা মুখস্থ করো: Identification → Analysis → Design → Implementation → System testing → Delivery। সাথে চারটা maintenance type-এর definition আর একটা করে example দিতেও তৈরি থেকো।

2. Requirements Engineering2. Requirements Engineering

Requirements engineering is the process of finding out, writing down, checking, and managing what the software must do. Most failed projects fail here — the team built the wrong thing.

Main activities: elicitation (gathering), analysis (making sense, removing conflicts), specification (writing the SRS), validation (checking the requirements themselves), and management (handling changes later).

Requirements engineering হলো software-কে কী করতে হবে তা খুঁজে বের করা, লিখে রাখা, check করা আর manage করার process। বেশিরভাগ fail করা project এখানেই fail করে — team ভুল জিনিস বানিয়ে ফেলে।

মূল কাজগুলো: elicitation (তথ্য সংগ্রহ), analysis (বোঝা, conflict সরানো), specification (SRS লেখা), validation (requirement গুলোই ঠিক আছে কি না check করা), আর management (পরে change সামলানো)।

Functional vs Non-functional requirementsFunctional vs Non-functional requirements

Functional requirements (FR) say WHAT the system must do — its features and behaviors. Non-functional requirements (NFR) say HOW WELL it must do it — quality attributes like speed, security, usability. NFRs are often called quality requirements or "-ilities".

Functional requirement (FR) বলে system-কে কী করতে হবে — তার feature আর behavior। Non-functional requirement (NFR) বলে সেটা কত ভালোভাবে করতে হবে — speed, security, usability-র মতো quality। NFR-কে অনেক সময় quality requirement বা "-ilities" বলা হয়।

Functional (WHAT)Functional (কী) Non-functional (HOW WELL)Non-functional (কত ভালো)
Meaningমানে A service or behavior the system must provideSystem-কে যে service বা behavior দিতে হবে A quality/constraint on how the system worksSystem কেমনভাবে কাজ করবে তার quality/constraint
ATM exampleATM example "User can withdraw cash after entering a correct PIN.""সঠিক PIN দিলে user টাকা withdraw করতে পারবে।" "Cash must be dispensed within 10 seconds.""১০ second-এর মধ্যে টাকা বের হতে হবে।"
E-commerce exampleE-commerce example "System sends an email after each order.""প্রতিটা order-এর পরে system একটা email পাঠাবে।" "Site must handle 10,000 users at once; 99.9% uptime.""Site-কে একসাথে ১০,০০০ user সামলাতে হবে; 99.9% uptime।"
Common typesCommon type Login, search, report generation, paymentLogin, search, report generation, payment Performance, security, reliability, usability, portability, maintainabilityPerformance, security, reliability, usability, portability, maintainability
Tested byকীভাবে test হয় Functional testing (does the feature work?)Functional testing (feature কাজ করে?) Performance/load/security testing (is it good enough?)Performance/load/security testing (যথেষ্ট ভালো?)
Exam tip: Quick test — if the sentence describes a feature or action, it is functional. If it has a number about speed, load, uptime, or words like "secure", "easy to use", it is non-functional. "The system shall encrypt passwords" is functional (an action); "the system shall be secure" is non-functional (a quality).
Exam tip: সহজ পরীক্ষা — বাক্যটা কোনো feature বা action বললে সেটা functional। speed, load, uptime-এর number বা "secure", "easy to use" জাতীয় শব্দ থাকলে সেটা non-functional। "System password encrypt করবে" — functional (একটা action); "System secure হবে" — non-functional (একটা quality)।

Elicitation techniquesElicitation techniques

Elicitation = collecting requirements from stakeholders. Common techniques:

  • Interviews — one-to-one talks with users/managers. Deep but slow.
  • Questionnaires/surveys — many people, cheap, but shallow answers.
  • Observation (ethnography) — watch users do their real work; catches things people forget to say.
  • Workshops / brainstorming (JAD sessions) — all stakeholders in one room, fast agreement.
  • Prototyping — show a mock version, users react to something concrete.
  • Document analysis — read existing forms, reports, and old system manuals.
  • Use cases / user stories — describe requirements as user–system interactions.

Elicitation = stakeholder-দের কাছ থেকে requirement সংগ্রহ করা। Common technique গুলো:

  • Interview — user/manager-এর সাথে একা একা কথা বলা। গভীরে যাওয়া যায়, কিন্তু slow।
  • Questionnaire/survey — অনেক মানুষ, সস্তা, কিন্তু উত্তর অগভীর।
  • Observation (ethnography) — user-দের আসল কাজ করা দেখা; মানুষ যা বলতে ভুলে যায় তা ধরা পড়ে।
  • Workshop / brainstorming (JAD session) — সব stakeholder এক ঘরে, দ্রুত ঐকমত্য।
  • Prototyping — একটা mock version দেখানো, user concrete কিছু দেখে react করে।
  • Document analysis — চালু form, report আর পুরনো system-এর manual পড়া।
  • Use case / user story — user–system interaction হিসেবে requirement লেখা।

SRS — Software Requirements SpecificationSRS — Software Requirements Specification

The SRS is the official document that records all requirements. It is a contract between customer and developers. A good SRS is: correct, complete, consistent, unambiguous, verifiable, traceable, and modifiable.

Typical structure (based on IEEE 830):

  1. Introduction — purpose, scope, definitions, references.
  2. Overall description — product perspective, user classes, operating environment, constraints, assumptions.
  3. Specific requirements — all functional requirements (numbered, e.g., FR-1, FR-2), external interfaces, non-functional requirements (performance, security, etc.).
  4. Appendices and index.

SRS হলো official document যেখানে সব requirement লেখা থাকে। এটা customer আর developer-দের মধ্যে একটা contract। ভালো SRS হয়: correct, complete, consistent, unambiguous, verifiable, traceable, modifiable

Typical structure (IEEE 830 অনুযায়ী):

  1. Introduction — purpose, scope, definition, reference।
  2. Overall description — product perspective, user class, operating environment, constraint, assumption।
  3. Specific requirements — সব functional requirement (number দিয়ে, যেমন FR-1, FR-2), external interface, non-functional requirement (performance, security ইত্যাদি)।
  4. Appendix আর index।

Requirements validationRequirements validation

Validation checks the requirements THEMSELVES before building anything. We ask: are they complete? consistent (no two requirements conflict)? realistic (can we build this with our budget/technology)? verifiable (can we test it later)?

Techniques: requirements reviews (a team reads the SRS line by line), prototyping (show users), and test-case generation (if you cannot write a test for a requirement, the requirement is too vague — e.g., "the system shall be fast" is not verifiable).

Validation-এ কিছু বানানোর আগেই requirement গুলোকেই check করা হয়। প্রশ্ন করি: complete তো? consistent তো (দুটো requirement-এ conflict নেই)? realistic তো (budget/technology দিয়ে বানানো সম্ভব)? verifiable তো (পরে test করা যাবে)?

Technique: requirements review (একটা team SRS লাইন ধরে ধরে পড়ে), prototyping (user-দের দেখানো), আর test-case generation (কোনো requirement-এর জন্য test লেখা না গেলে সেটা বেশি vague — যেমন "system fast হবে" verifiable না)।

Use cases — with a worked exampleUse case — worked example সহ

A use case describes one goal-oriented interaction between an actor (a user or external system) and the system. It has a main success flow and alternate/exception flows.

Use case হলো একজন actor (user বা বাইরের কোনো system) আর system-এর মধ্যে একটা goal-ভিত্তিক interaction-এর বর্ণনা। এতে একটা main success flow আর কিছু alternate/exception flow থাকে।

Example: Use case "Withdraw Cash" (ATM)
  • Actors: Customer (primary), Bank server (secondary).
  • Precondition: ATM has cash; customer has a valid card.
  • Main flow:
    1. Customer inserts card.
    2. System asks for PIN; customer enters PIN.
    3. System verifies PIN with the bank server.
    4. Customer selects "Withdraw" and enters an amount.
    5. System checks balance and cash availability.
    6. System dispenses cash, prints receipt, returns card.
  • Alternate flow A1 (wrong PIN): At step 3, if the PIN is wrong, system shows an error and re-asks. After 3 failures, system keeps the card and ends the use case.
  • Alternate flow A2 (insufficient balance): At step 5, if balance is too low, system shows "insufficient funds" and returns to step 4.
  • Postcondition: Account debited exactly by the dispensed amount.
Example: Use case "Withdraw Cash" (ATM)
  • Actor: Customer (primary), Bank server (secondary)।
  • Precondition: ATM-এ টাকা আছে; customer-এর valid card আছে।
  • Main flow:
    1. Customer card ঢোকায়।
    2. System PIN চায়; customer PIN দেয়।
    3. System bank server দিয়ে PIN verify করে।
    4. Customer "Withdraw" select করে amount দেয়।
    5. System balance আর ATM-এর cash check করে।
    6. System টাকা দেয়, receipt print করে, card ফেরত দেয়।
  • Alternate flow A1 (ভুল PIN): Step 3-এ PIN ভুল হলে system error দেখিয়ে আবার PIN চায়। ৩ বার ভুল হলে card রেখে দিয়ে use case শেষ করে।
  • Alternate flow A2 (balance কম): Step 5-এ balance কম হলে system "insufficient funds" দেখিয়ে step 4-এ ফিরে যায়।
  • Postcondition: ঠিক যত টাকা বের হয়েছে, account থেকে তত টাকাই কাটা হয়েছে।
Exam tip: When asked to "write a use case", always give: name, actors, precondition, numbered main flow, at least one alternate flow, postcondition. The alternate flow is where marks are won.
Exam tip: "Use case লেখো" বললে সবসময় দাও: name, actor, precondition, number করা main flow, অন্তত একটা alternate flow, postcondition। Alternate flow-তেই বেশি নম্বর ওঠে।

3. UML and Design3. UML and Design

UML (Unified Modeling Language) is a standard set of diagrams for drawing software designs. Why model? Because a picture lets the whole team share one understanding, find design mistakes BEFORE coding, and document the system for the future. UML diagrams split into two families: structural (class, component, deployment) and behavioral (use case, sequence, activity, state).

UML (Unified Modeling Language) হলো software design আঁকার জন্য standard কিছু diagram। Model কেন করব? কারণ একটা ছবি দিয়ে পুরো team একই জিনিস বোঝে, coding-এর আগেই design-এর ভুল ধরা পড়ে, আর ভবিষ্যতের জন্য system-টা documented থাকে। UML diagram দুই দলে ভাগ হয়: structural (class, component, deployment) আর behavioral (use case, sequence, activity, state)।

Class diagramClass diagram

A class diagram shows classes and the relationships between them. Each class is a box with 3 parts: name, attributes, methods. Visibility marks: + public, - private, # protected, ~ package.

Attribute format: - balance : double. Method format: + deposit(amount : double) : void.

Class diagram দেখায় class গুলো আর তাদের মধ্যের relationship। প্রতিটা class হলো ৩ ভাগের একটা box: name, attribute, method। Visibility চিহ্ন: + public, - private, # protected, ~ package।

Attribute-এর format: - balance : double। Method-এর format: + deposit(amount : double) : void

Account - accountNo : String - balance : double + deposit(amt) : void + withdraw(amt) : bool SavingsAccount - interestRate : double + addInterest() : void Customer - name : String + openAccount() : void inheritance (is-a) owns 1..* 1 Transaction - amount : double composition (part-of)
Class diagram: SavingsAccount inherits Account; Customer owns 1..* Accounts (association); Transaction is a part of Account (composition, filled diamond at the whole).Class diagram: SavingsAccount, Account-কে inherit করে; Customer-এর 1..* Account আছে (association); Transaction হলো Account-এর part (composition, filled diamond থাকে whole-এর দিকে)।

Relationships and their arrowsRelationship আর তাদের arrow

RelationshipRelationship NotationNotation Meaningমানে ExampleExample
Association Plain line ——সাধারণ line —— "knows / uses" — a general link"চেনে / ব্যবহার করে" — সাধারণ সম্পর্ক Teacher — StudentTeacher — Student
Aggregation Line with HOLLOW diamond ◇—HOLLOW diamond সহ line ◇— "has-a", weak whole–part; part can live alone"has-a", দুর্বল whole–part; part একা বাঁচতে পারে Team ◇— Player (player exists without team)Team ◇— Player (team ছাড়াও player থাকে)
Composition Line with FILLED diamond ◆—FILLED diamond সহ line ◆— "part-of", strong whole–part; part dies with the whole"part-of", শক্ত whole–part; whole গেলে part-ও যায় House ◆— Room (delete house → rooms gone)House ◆— Room (house delete → room-ও শেষ)
Inheritance (generalization) Line with HOLLOW triangle —▷ at parentParent-এর দিকে HOLLOW triangle —▷ "is-a""is-a" Dog —▷ AnimalDog —▷ Animal
Dependency DASHED arrow - - ->DASHED arrow - - -> "temporarily uses" (e.g., as a method parameter)"সাময়িকভাবে ব্যবহার করে" (যেমন method parameter হিসেবে) OrderService - - -> EmailSenderOrderService - - -> EmailSender
Realization (implements) DASHED line with hollow triangle - -▷DASHED line + hollow triangle - -▷ Class implements an interfaceClass একটা interface implement করে ArrayList - -▷ ListArrayList - -▷ List
Exam tip (very common!): Aggregation vs composition — both are whole–part, the difference is lifetime. Hollow diamond (aggregation) = part survives without the whole (Team–Player). Filled diamond (composition) = part cannot exist without the whole (House–Room, Order–OrderLine). The diamond always sits on the WHOLE side.
Exam tip (খুবই common!): Aggregation vs composition — দুটোই whole–part, পার্থক্য হলো lifetime। Hollow diamond (aggregation) = whole ছাড়াও part বাঁচে (Team–Player)। Filled diamond (composition) = whole ছাড়া part থাকতেই পারে না (House–Room, Order–OrderLine)। Diamond সবসময় WHOLE-এর পাশে বসে।

Use case diagramUse case diagram

A use case diagram gives a bird's-eye view: stick-figure actors outside a system boundary box, oval use cases inside, lines connecting actors to their use cases. Two special arrows: «include» (one use case ALWAYS uses another, e.g., "Withdraw Cash" includes "Verify PIN") and «extend» (optional extra behavior, e.g., "Print Receipt" extends "Withdraw Cash").

Use case diagram উপর থেকে পুরো ছবিটা দেখায়: system boundary box-এর বাইরে stick-figure actor, ভেতরে oval use case, আর actor-দের সাথে use case-এর সংযোগ line। দুটো special arrow: «include» (একটা use case সবসময় আরেকটা ব্যবহার করে, যেমন "Withdraw Cash" includes "Verify PIN") আর «extend» (optional বাড়তি behavior, যেমন "Print Receipt" extends "Withdraw Cash")।

Sequence diagram — worked exampleSequence diagram — worked example

A sequence diagram shows objects as vertical lifelines and messages as horizontal arrows, ordered top to bottom by TIME. Solid arrow = call, dashed arrow = return. The thin rectangles on lifelines (activation bars) show when an object is busy.

Sequence diagram-এ object গুলো লম্বালম্বি lifeline, আর message গুলো আড়াআড়ি arrow — উপরে থেকে নিচে TIME অনুযায়ী সাজানো। Solid arrow = call, dashed arrow = return। Lifeline-এর উপরের চিকন rectangle (activation bar) দেখায় object কখন busy।

:Customer :ATM :BankServer insertCard + PIN verifyPIN(card, pin) PIN ok withdraw(5000) checkBalance + debit approved dispense cash receipt + card
Sequence diagram for ATM cash withdrawal: time flows downward; solid = call, dashed = return.ATM-এ টাকা তোলার sequence diagram: সময় নিচের দিকে যায়; solid = call, dashed = return।

Activity and State diagrams (briefly)Activity আর State diagram (সংক্ষেপে)

  • Activity diagram: a flowchart of actions — rounded boxes for activities, diamond for decisions, bars for parallel (fork/join), filled circle for start, bullseye for end. Good for showing a business process or an algorithm's flow.
  • State diagram (state machine): shows the STATES of ONE object and the events that move it between states. Example: an Order goes Created → Paid → Shipped → Delivered, with events like "payment received". Good for objects with clear life stages (order, connection, traffic light).

Quick memory: activity diagram = flow of a process; state diagram = life of an object; sequence diagram = messages over time between objects.

  • Activity diagram: কাজের flowchart — activity-র জন্য rounded box, decision-এর জন্য diamond, parallel-এর জন্য bar (fork/join), শুরুতে ভরা circle, শেষে bullseye। Business process বা algorithm-এর flow দেখাতে ভালো।
  • State diagram (state machine): একটা object-এর STATE গুলো আর কোন event-এ state বদলায় তা দেখায়। যেমন: একটা Order যায় Created → Paid → Shipped → Delivered, event যেমন "payment received"। যেসব object-এর পরিষ্কার জীবন-ধাপ আছে (order, connection, traffic light) তাদের জন্য ভালো।

সহজে মনে রাখো: activity diagram = একটা process-এর flow; state diagram = একটা object-এর জীবন; sequence diagram = object-দের মধ্যে সময় ধরে message

Worked example: class diagram for an online shopping site (Real Exam Question!)Worked example: online shopping site-এর class diagram (Real Exam Question!)

BUET asked students to draw a class diagram for an online shopping site with classes like Customer, Order, Product, ShoppingCart, and Payment. Here is a clean model answer. First learn the relationships, then the picture:

BUET-এ online shopping site-এর class diagram আঁকতে বলা হয়েছিল — Customer, Order, Product, ShoppingCart, Payment এই class গুলো দিয়ে। নিচে একটা পরিষ্কার model answer। আগে relationship গুলো শেখো, তারপর ছবিটা:

RelationshipRelationship MultiplicityMultiplicity Meaningমানে
Customer — Order 1 — * One customer places many orders; each order belongs to exactly one customer.এক customer অনেক order দেয়; প্রতিটা order ঠিক একজন customer-এর।
Order — Product (via OrderItem) * — * An order holds many products, a product appears in many orders — so we put an OrderItem class in between (with quantity and price). Order ◆— OrderItem is composition.এক order-এ অনেক product, এক product অনেক order-এ — তাই মাঝে একটা OrderItem class বসাই (quantity আর price সহ)। Order ◆— OrderItem হলো composition।
Customer — ShoppingCart 1 — 1 Each customer has exactly one active cart.প্রতিটা customer-এর ঠিক একটা active cart।
Order — Payment 1 — 1 Each order is settled by exactly one payment.প্রতিটা order ঠিক একটা payment দিয়ে মেটে।
Customer - name : String - email : String + placeOrder() ShoppingCart - items : List + addItem(p, qty) + checkout() Order - orderNo : String - date : Date + total() : double Payment - amount : double - method : String + pay() : bool OrderItem - quantity : int - unitPrice : double Product - name : String - price : double has 1 1 1 1..* places paid by 1 1 contains 1..* * 1
Model answer: Customer 1—1 ShoppingCart, Customer 1—* Order, Order 1—1 Payment, Order ◆— OrderItem (composition) —* Product. The OrderItem class turns the many-to-many Order–Product link into two clean one-to-many links.Model answer: Customer 1—1 ShoppingCart, Customer 1—* Order, Order 1—1 Payment, Order ◆— OrderItem (composition) —* Product। OrderItem class-টা Order–Product-এর many-to-many সম্পর্ককে দুটো পরিষ্কার one-to-many সম্পর্কে ভেঙে দেয়।

Worked example: state diagram for the order workflowWorked example: order workflow-এর state diagram

The same BUET question also asked for a state diagram of the shopping workflow. Model ONE object — the Order — and show its states and the events that move it:

একই BUET প্রশ্নে shopping workflow-এর একটা state diagram-ও চাওয়া হয়েছিল। একটা object — Order — ধরে তার state গুলো আর কোন event-এ state বদলায় তা দেখাও:

Cart Placed Paid Shipped Delivered Cancelled checkout payment ok dispatch delivered customer cancels cancel + refund
Order state diagram: Cart → (checkout) → Placed → (payment ok) → Paid → (dispatch) → Shipped → (delivered) → Delivered. Cancelled is reachable from Placed (simple cancel) and from Paid (cancel with refund). After Shipped, cancelling is no longer allowed.Order-এর state diagram: Cart → (checkout) → Placed → (payment ok) → Paid → (dispatch) → Shipped → (delivered) → Delivered। Cancelled-এ যাওয়া যায় Placed থেকে (সাধারণ cancel) আর Paid থেকে (refund সহ cancel)। Shipped-এর পরে আর cancel করা যায় না।
Real BUET question (April 2019): "Draw a UML class diagram for an online shopping site" and "draw a state diagram for the online shopping workflow" were asked exactly like this. In a class diagram answer, always show: class boxes with a few attributes/methods, multiplicities (1, 1..*, *), and name the relationship types (association, composition). In a state diagram, always include a start dot, event labels on every arrow, and the Cancelled path.
Real BUET question (April 2019): "Online shopping site-এর UML class diagram আঁকো" আর "online shopping workflow-এর state diagram আঁকো" — ঠিক এভাবেই এসেছিল। Class diagram-এর answer-এ সবসময় দাও: কিছু attribute/method সহ class box, multiplicity (1, 1..*, *), আর relationship-এর ধরন (association, composition)-এর নাম। State diagram-এ সবসময় রাখো: start dot, প্রতিটা arrow-তে event-এর label, আর Cancelled-এ যাওয়ার path।

4. Software Testing4. Software Testing

Testing means running the software with the goal of FINDING defects. Testing can show that bugs exist — it can never prove there are zero bugs (Dijkstra's famous point).

Testing মানে defect খুঁজে বের করার লক্ষ্যে software চালানো। Testing দেখাতে পারে bug আছে — কিন্তু bug একটাও নেই, এটা কখনো প্রমাণ করতে পারে না (Dijkstra-র বিখ্যাত কথা)।

Testing levelsTesting level

  1. Unit testing — test one function/class alone. Done by developers. Example: test that withdraw() rejects a negative amount.
  2. Integration testing — test that modules work TOGETHER (interfaces between them). Approaches: big bang (join everything at once), top-down (use stubs for missing lower modules), bottom-up (use drivers for missing upper modules).
  3. System testing — test the whole finished system against the SRS, in an environment like production.
  4. Acceptance testing — the CUSTOMER tests whether the system meets their needs. Includes alpha testing (at the developer's site, controlled) and beta testing (at real users' sites, real environment).
  1. Unit testing — একটা function/class আলাদা করে test করা। Developer-রা করে। যেমন: withdraw() negative amount reject করে কি না।
  2. Integration testing — module গুলো একসাথে কাজ করে কি না (তাদের মধ্যের interface) test করা। উপায়: big bang (সব একসাথে জোড়া), top-down (নিচের missing module-এর জায়গায় stub), bottom-up (উপরের missing module-এর জায়গায় driver)।
  3. System testing — পুরো system-কে SRS-এর সাথে মিলিয়ে test করা, production-এর মতো environment-এ।
  4. Acceptance testing — CUSTOMER নিজে test করে system তার দরকার মেটায় কি না। এর মধ্যে alpha testing (developer-এর জায়গায়, controlled) আর beta testing (আসল user-দের জায়গায়, real environment)।

Black box vs White boxBlack box vs White box

Black box testingBlack box testing White box testingWhite box testing
Looks atকী দেখে Inputs and outputs only; code is hiddenশুধু input আর output; code দেখা যায় না The internal code and structureভেতরের code আর structure
Based onভিত্তি Requirements / specificationRequirement / specification Source code paths and branchesSource code-এর path আর branch
TechniquesTechnique Equivalence partitioning, boundary value analysis, decision tablesEquivalence partitioning, boundary value analysis, decision table Statement / branch / path coverage, loop testingStatement / branch / path coverage, loop testing
Done byকারা করে Testers (no code knowledge needed)Tester-রা (code জানা লাগে না) DevelopersDeveloper-রা
Typical levelTypical level System / acceptance testingSystem / acceptance testing Unit testingUnit testing

Equivalence partitioning + Boundary value analysisEquivalence partitioning + Boundary value analysis

Equivalence partitioning (EP): split the input space into groups (partitions) where every value in a group should behave the SAME. Test just one value per group — no need to test all.

Boundary value analysis (BVA): bugs love edges. Test the values AT and NEXT TO each boundary: for a range [min, max], test min−1, min, min+1, max−1, max, max+1 (a lighter version uses min, max and one middle value).

Equivalence partitioning (EP): input-এর জগৎটাকে কিছু দলে (partition) ভাগ করো, যেখানে এক দলের সব value-র behavior একই হওয়ার কথা। প্রতি দল থেকে মাত্র একটা value test করো — সব test করার দরকার নেই।

Boundary value analysis (BVA): bug থাকে কিনারায়। প্রতিটা boundary-র উপর আর ঠিক পাশের value test করো: range [min, max]-এর জন্য min−1, min, min+1, max−1, max, max+1 (হালকা version-এ min, max আর মাঝের একটা value)।

Example (numeric): An exam-marks field accepts integers 0 to 100.
  • EP partitions: P1 = valid (0–100), P2 = invalid low (< 0), P3 = invalid high (> 100). → 3 test cases, e.g., 50, −5, 150.
  • BVA values: boundaries are 0 and 100 → test −1, 0, 1 and 99, 100, 101 → 6 test cases.
  • Combined smart set: {−1, 0, 1, 50, 99, 100, 101}.
Example (number দিয়ে): একটা exam-marks field 0 থেকে 100 integer নেয়।
  • EP partition: P1 = valid (0–100), P2 = invalid low (< 0), P3 = invalid high (> 100)। → ৩টা test case, যেমন 50, −5, 150।
  • BVA value: boundary হলো 0 আর 100 → test করো −1, 0, 1 আর 99, 100, 101 → ৬টা test case।
  • দুটো মিলিয়ে smart set: {−1, 0, 1, 50, 99, 100, 101}।

Statement, branch, and path coverageStatement, branch, path coverage

Coverage measures how much of the code your tests actually exercised.

  • Statement coverage: every line runs at least once.
  • Branch (decision) coverage: every decision (if/while) takes BOTH the true and false way at least once. Stronger than statement coverage.
  • Path coverage: every possible route through the code runs. Strongest, but paths explode fast (2 independent ifs → 4 paths).

Coverage মাপে তোমার test আসলে কতটুকু code চালিয়েছে।

  • Statement coverage: প্রতিটা line অন্তত একবার চলে।
  • Branch (decision) coverage: প্রতিটা decision (if/while)-এর true আর false — দুই দিকই অন্তত একবার চলে। Statement coverage-এর চেয়ে শক্ত।
  • Path coverage: code-এর ভেতর দিয়ে সম্ভব সব route চলে। সবচেয়ে শক্ত, কিন্তু path খুব দ্রুত বাড়ে (২টা আলাদা if → ৪টা path)।
Example (count the test cases): Look at this code.
Example (test case গোনা): এই code-টা দেখো।
int max3(int a, int b, int c) {
    int m = a;              // S1
    if (b > m) m = b;       // D1
    if (c > m) m = c;       // D2
    return m;               // S2
}
  • Statement coverage: ONE test where both ifs are true covers all lines. E.g., (a,b,c) = (1,2,3). → 1 test case.
  • Branch coverage: D1 and D2 each need true AND false. Test 1: (1,2,3) → D1 true, D2 true. Test 2: (3,2,1) → D1 false, D2 false. → 2 test cases.
  • Path coverage: paths = TT, TF, FT, FF → 4 test cases, e.g., (1,2,3), (1,3,2), (2,1,3), (3,2,1).
  • Statement coverage: দুটো if-ই true হয় এমন একটা test-এই সব line চলে। যেমন (a,b,c) = (1,2,3)। → ১টা test case।
  • Branch coverage: D1 আর D2 দুটোরই true এবং false লাগবে। Test 1: (1,2,3) → D1 true, D2 true। Test 2: (3,2,1) → D1 false, D2 false। → ২টা test case।
  • Path coverage: path = TT, TF, FT, FF → ৪টা test case, যেমন (1,2,3), (1,3,2), (2,1,3), (3,2,1)।

Verification vs Validation, regression, alpha/betaVerification vs Validation, regression, alpha/beta

  • Verification: "Are we building the product RIGHT?" — checking the work against the design/spec at each phase (reviews, inspections, walkthroughs; mostly static, done during development).
  • Validation: "Are we building the RIGHT product?" — checking the finished product against the USER's real needs (actual testing, mostly dynamic).
  • Regression testing: after any change or bug fix, RE-RUN old tests to make sure previously working features did not break. Usually automated.
  • Alpha testing: by internal users/testers at the developer's site, before release.
  • Beta testing: by real external users at their own sites, on a near-final version.
  • Verification: "আমরা কি product-টা ঠিকভাবে বানাচ্ছি?" — প্রতিটা phase-এ design/spec-এর সাথে কাজ মিলিয়ে দেখা (review, inspection, walkthrough; বেশিরভাগ static, development চলার সময়ে)।
  • Validation: "আমরা কি ঠিক product-টাই বানাচ্ছি?" — শেষ হওয়া product USER-এর আসল দরকারের সাথে মেলে কি না দেখা (আসল testing, বেশিরভাগ dynamic)।
  • Regression testing: কোনো change বা bug fix-এর পরে পুরনো test গুলো আবার চালানো, আগের কাজ করা feature ভাঙেনি তো — এটা দেখতে। সাধারণত automated।
  • Alpha testing: developer-এর জায়গায় internal user/tester দিয়ে, release-এর আগে।
  • Beta testing: বাইরের আসল user-রা নিজেদের জায়গায়, প্রায়-final version-এ।
One-liner to memorize: Verification = building the product right (matches spec). Validation = building the right product (matches user needs). Verification comes first; validation comes at the end.
মুখস্থ করার one-liner: Verification = product-টা ঠিকভাবে বানানো (spec-এর সাথে মেলে)। Validation = ঠিক product-টা বানানো (user-এর দরকারের সাথে মেলে)। Verification আগে; validation শেষে।

5. Software Architecture & Design Principles5. Software Architecture & Design Principles

Software architecture is the high-level structure of a system: its main parts and how they talk to each other. Common architectural styles:

  • Layered: code stacked in layers (presentation → business logic → data access → database). Each layer only calls the layer below. Easy to understand and replace layers; can be slow if a request must pass through many layers.
  • Client–server: many clients request services from a central server (web browser ↔ web server). Central control and data, but the server is a bottleneck and single point of failure.
  • MVC (Model–View–Controller): splits an interactive app into Model (data + business rules), View (what the user sees), Controller (receives user input, updates model, picks the view). One model can have many views; UI and logic change independently.
  • Monolith vs Microservices: a monolith is one big deployable unit — simple to build/test/deploy at first, but hard to scale and one bug can crash everything. Microservices split the system into small independent services, each with its own database, talking over the network (HTTP/queues) — independent scaling and deployment, but complex operations, network latency, and hard distributed debugging.

Software architecture হলো system-এর high-level গঠন: তার প্রধান অংশগুলো আর তারা কীভাবে কথা বলে। Common architectural style:

  • Layered: code স্তরে স্তরে সাজানো (presentation → business logic → data access → database)। প্রতিটা layer শুধু নিচের layer-কে ডাকে। বোঝা আর layer বদলানো সহজ; অনেক layer পার হতে হলে slow হতে পারে।
  • Client–server: অনেক client একটা central server থেকে service চায় (web browser ↔ web server)। Control আর data এক জায়গায়, কিন্তু server হলো bottleneck আর single point of failure।
  • MVC (Model–View–Controller): interactive app-কে তিন ভাগ করে: Model (data + business rule), View (user যা দেখে), Controller (user input নেয়, model update করে, view বাছে)। এক model-এর অনেক view হতে পারে; UI আর logic আলাদাভাবে বদলানো যায়।
  • Monolith vs Microservices: Monolith মানে একটাই বড় deployable unit — শুরুতে বানানো/test/deploy সহজ, কিন্তু scale করা কঠিন আর একটা bug-এ সব crash করতে পারে। Microservices-এ system ছোট ছোট independent service-এ ভাগ হয়, প্রতিটার নিজের database, network-এ (HTTP/queue) কথা বলে — আলাদা scaling আর deployment, কিন্তু operation জটিল, network latency, আর distributed debugging কঠিন।
MVC Controller Model View updates selects data user input → Controller; View shows Model data Layered Presentation (UI) Business logic Data access Database
MVC (left): Controller updates Model, selects View. Layered (right): each layer calls only the layer below.MVC (বামে): Controller, Model update করে আর View বাছে। Layered (ডানে): প্রতিটা layer শুধু নিচের layer-কে ডাকে।

Coupling and cohesionCoupling আর cohesion

Coupling = how much modules depend on EACH OTHER. Cohesion = how strongly the parts INSIDE one module belong together. Design goal (memorize this): LOW coupling, HIGH cohesion. Then a change in one module barely touches others, and each module is easy to understand, test, and reuse.

Coupling = module গুলো একে অপরের উপর কতটা নির্ভর করে। Cohesion = এক module-এর ভেতরের জিনিসগুলো কতটা একসাথে মানায়। Design-এর goal (মুখস্থ করো): LOW coupling, HIGH cohesion। তাহলে এক module বদলালে অন্যরা প্রায় টেরই পায় না, আর প্রতিটা module বোঝা, test করা, reuse করা সহজ হয়।

Coupling type (worst → best)Coupling type (খারাপ → ভালো) Meaningমানে ExampleExample
ContentOne module directly edits another's internal code/dataএক module আরেকটার ভেতরের code/data সরাসরি বদলায়Module A jumps into B's code or patches B's private variableA, B-এর code-এ ঢুকে যায় বা B-এর private variable বদলায়
CommonModules share the same global dataModule-রা একই global data শেয়ার করেEveryone reads/writes one global config variableসবাই একটা global config variable পড়ে/লেখে
ControlOne module passes a flag that controls the other's logicএক module একটা flag পাঠায় যা অন্যটার logic ঠিক করেprint(data, mode=2) — mode decides what the function doesprint(data, mode=2) — mode ঠিক করে function কী করবে
StampPassing a whole structure when only a part is neededশুধু একটা অংশ দরকার, তবু পুরো structure পাঠানোPassing full Student record to a function that needs only the idশুধু id দরকার এমন function-এ পুরো Student record পাঠানো
DataModules share only simple data as parameters — BEST practical couplingModule-রা শুধু simple data parameter হিসেবে দেয় — practical-এ সবচেয়ে ভালোadd(a, b) — only the needed values are passedadd(a, b) — শুধু দরকারি value পাঠানো হয়

Cohesion types, best → worst: functional (module does exactly one task — best), sequential (output of one part feeds the next), communicational (parts work on the same data), procedural, temporal (things done "at the same time", e.g., init), logical (similar-looking tasks lumped together), coincidental (random unrelated stuff — worst, e.g., a "Utils" class holding date parsing + email + tax math).

Cohesion type, ভালো → খারাপ: functional (module ঠিক একটা কাজ করে — best), sequential (এক অংশের output পরের অংশের input), communicational (সব অংশ একই data নিয়ে কাজ করে), procedural, temporal ("একই সময়ে" করা কাজ, যেমন init), logical (দেখতে একরকম কাজ এক জায়গায়), coincidental (এলোমেলো সম্পর্কহীন জিনিস — worst, যেমন এক "Utils" class-এ date parsing + email + tax হিসাব)।

Exam note: asked October 2017 in an IS-design framing — the paper said "system cohesion" and "component coupling", but the answer is exactly this coupling/cohesion material.
Exam note: October 2017-এ এটা IS-design-এর ভাষায় এসেছিল — প্রশ্নে লেখা ছিল "system cohesion" আর "component coupling", কিন্তু উত্তরটা ঠিক এই coupling/cohesion-এর কথাগুলোই।
Example (Real exam style — asked October 2018): refactoring a messy codebase. You inherit a project with about 1000 tangled functions in a few giant files — everything calls everything. How do you clean it up?
  1. Write tests FIRST. Before touching anything, put tests around the current behavior (at least the important paths). Refactoring means changing structure WITHOUT changing behavior — tests prove you did not break it.
  2. Group by responsibility. Sort the functions by what they are about (orders, payments, users, reports...). Move each group into its own module/class → this raises cohesion.
  3. Remove duplication (DRY). Merge the copy-pasted functions into one shared function each — 1000 functions usually shrink a lot here.
  4. Layer the code. Split UI code, business logic, and data access into layers; each layer only calls the layer below.
  5. Put interfaces at the seams. Modules talk through small interfaces and pass only the data they need → this lowers coupling, and lets you test or swap one part alone.
Result: same behavior, but low coupling and high cohesion — changes become cheap and safe.
Example (Real exam style — October 2018-এ এসেছিল): এলোমেলো codebase refactor করা। তুমি এমন একটা project পেলে যেখানে কয়েকটা বিশাল file-এ প্রায় ১০০০টা জট পাকানো function — সবাই সবাইকে ডাকে। কীভাবে পরিষ্কার করবে?
  1. আগে test লেখো। কিছুতে হাত দেওয়ার আগে এখনকার behavior ঘিরে test বসাও (অন্তত গুরুত্বপূর্ণ path-গুলোতে)। Refactoring মানে behavior না বদলে structure বদলানো — test-ই প্রমাণ করবে কিছু ভাঙোনি।
  2. Responsibility অনুযায়ী group করো। Function-গুলো কী নিয়ে কাজ করে সেই হিসেবে ভাগ করো (order, payment, user, report...)। প্রতিটা group-কে নিজের module/class-এ নাও → এতে cohesion বাড়ে।
  3. Duplication সরাও (DRY)। Copy-paste করা function-গুলো এক করে একটা shared function বানাও — ১০০০ function এখানেই অনেক কমে যায়।
  4. Code-কে layer করো। UI code, business logic আর data access আলাদা layer-এ ভাগ করো; প্রতিটা layer শুধু নিচের layer-কে ডাকবে।
  5. জোড়ার জায়গায় interface বসাও। Module-রা ছোট interface দিয়ে কথা বলবে, শুধু দরকারি data পাঠাবে → এতে coupling কমে, আর এক-একটা অংশ আলাদা করে test বা বদলানো যায়।
ফলাফল: behavior একই, কিন্তু low coupling আর high cohesion — এখন change করা সস্তা আর নিরাপদ।

SOLID principlesSOLID principles

  • S — Single Responsibility: a class should have ONE reason to change. Bad: Report class that computes data AND prints AND saves to DB. Good: split into ReportData, ReportPrinter, ReportSaver.
  • O — Open/Closed: open for extension, closed for modification. Bad: a big if (shape == "circle") ... else if (shape == "square") that must be edited for every new shape. Good: each shape class has its own area(); adding a shape adds a class, touches no old code.
  • L — Liskov Substitution: a subclass must be usable anywhere its parent is expected, without surprises. Classic violation: Square extends Rectangle but setWidth() secretly changes height too — code written for Rectangle breaks.
  • I — Interface Segregation: many small interfaces beat one fat one. Bad: Machine interface with print(), scan(), fax() forces a simple printer to implement fax. Good: separate Printer, Scanner, Fax interfaces.
  • D — Dependency Inversion: depend on abstractions (interfaces), not concrete classes. Bad: OrderService creates new MySQLDatabase() inside. Good: it receives a Database interface — swapping MySQL for Postgres or a test mock needs no change to OrderService.

DRY — Don't Repeat Yourself: one piece of knowledge lives in ONE place; copy-pasted logic means every bug must be fixed twice. KISS — Keep It Simple, Stupid: the simplest design that works beats a clever complicated one.

  • S — Single Responsibility: একটা class-এর বদলানোর কারণ একটাই হবে। খারাপ: Report class একই সাথে data হিসাব করে, print করে, DB-তে save করে। ভালো: ভাগ করো ReportData, ReportPrinter, ReportSaver-এ।
  • O — Open/Closed: extension-এর জন্য খোলা, modification-এর জন্য বন্ধ। খারাপ: বড় একটা if (shape == "circle") ... else if (shape == "square"), নতুন shape এলেই edit করতে হয়। ভালো: প্রতিটা shape class-এর নিজের area(); নতুন shape মানে নতুন class, পুরনো code-এ হাত নেই।
  • L — Liskov Substitution: parent যেখানে চলে, subclass-ও সেখানে কোনো surprise ছাড়া চলতে হবে। Classic ভুল: Square extends Rectangle, কিন্তু setWidth() চুপিচুপি height-ও বদলায় — Rectangle-এর জন্য লেখা code ভেঙে যায়।
  • I — Interface Segregation: একটা মোটা interface-এর চেয়ে অনেকগুলো ছোট interface ভালো। খারাপ: Machine interface-এ print(), scan(), fax() — simple printer-কেও fax implement করতে হয়। ভালো: আলাদা Printer, Scanner, Fax interface।
  • D — Dependency Inversion: concrete class না, abstraction (interface)-এর উপর নির্ভর করো। খারাপ: OrderService ভেতরে new MySQLDatabase() বানায়। ভালো: সে একটা Database interface নেয় — MySQL বদলে Postgres বা test mock দিলেও OrderService-এ হাত দিতে হয় না।

DRY — Don't Repeat Yourself: এক টুকরো knowledge এক জায়গাতেই থাকবে; copy-paste করা logic মানে প্রতিটা bug দুই জায়গায় fix করতে হবে। KISS — Keep It Simple, Stupid: কাজ করে এমন সবচেয়ে simple design-ই চালাক-জটিল design-এর চেয়ে ভালো।

Design patterns introDesign pattern-এর intro

A design pattern is a reusable, named solution to a common design problem. Three famous ones:

Singleton (creational): make sure a class has exactly ONE instance, with a global access point. Used for configs, loggers, connection pools.

Design pattern হলো common design problem-এর একটা reusable, নাম-দেওয়া সমাধান। বিখ্যাত ৩টা:

Singleton (creational): নিশ্চিত করে একটা class-এর instance ঠিক একটাই হবে, আর সেটায় global access থাকবে। Config, logger, connection pool-এ ব্যবহার হয়।

class Logger {
    private static Logger instance;      // the only one
    private Logger() {}                  // nobody else can create
    public static Logger getInstance() {
        if (instance == null) instance = new Logger();
        return instance;
    }
}

Factory Method (creational): let a factory decide WHICH concrete class to create, so the caller never writes new ConcreteClass() itself.

Factory Method (creational): কোন concrete class বানানো হবে সেটা factory ঠিক করে, তাই caller-কে নিজে কখনো new ConcreteClass() লিখতে হয় না।

Shape createShape(String type) {
    if (type.equals("circle")) return new Circle();
    if (type.equals("square")) return new Square();
    throw new IllegalArgumentException(type);
}
// caller: Shape s = createShape("circle"); s.draw();

Observer (behavioral): one subject keeps a list of observers; when the subject's state changes, it notifies all of them. This is the idea behind event listeners, notifications, and MVC's model→view updates.

Observer (behavioral): একটা subject কিছু observer-এর list রাখে; subject-এর state বদলালে সে সবাইকে notify করে। Event listener, notification, আর MVC-র model→view update-এর পেছনের idea এটাই।

interface Observer { void update(float temp); }

class WeatherStation {                    // subject
    private List<Observer> obs = new ArrayList<>();
    void attach(Observer o) { obs.add(o); }
    void setTemp(float t) {
        for (Observer o : obs) o.update(t);   // notify all
    }
}

Worked example: Strategy Pattern for sorting (Real Exam Question!)Worked example: sorting-এর জন্য Strategy Pattern (Real Exam Question!)

Strategy (behavioral): define a family of algorithms, put each one in its own class behind ONE common interface, and let the client swap them at runtime. Classic example: a Sorter that can use QuickSort or MergeSort without changing its own code.

Strategy (behavioral): একগুচ্ছ algorithm-কে একটাই common interface-এর পেছনে আলাদা আলাদা class-এ রাখো, আর client runtime-এ সেগুলো swap করতে পারে। Classic example: একটা Sorter যে নিজের code না বদলে QuickSort বা MergeSort ব্যবহার করতে পারে।

interface SortStrategy {                  // the common interface
    void sort(int[] a);
}

class QuickSort implements SortStrategy { // concrete strategy 1
    public void sort(int[] a) { /* quicksort logic */ }
}

class MergeSort implements SortStrategy { // concrete strategy 2
    public void sort(int[] a) { /* mergesort logic */ }
}

class Sorter {                            // the CONTEXT
    private SortStrategy strategy;
    Sorter(SortStrategy s) { strategy = s; }
    void setStrategy(SortStrategy s) { strategy = s; } // swap at runtime
    void sortData(int[] a) { strategy.sort(a); }
}

// usage:
Sorter sorter = new Sorter(new QuickSort());
sorter.sortData(data);                    // sorts with quicksort
sorter.setStrategy(new MergeSort());
sorter.sortData(data);                    // now mergesort — Sorter unchanged

When to use it: (1) you need to pick the algorithm at runtime — e.g., small array → insertion sort, huge array → merge sort; (2) you want to add new algorithms WITHOUT touching old code — that is exactly the Open/Closed principle: a new algorithm is just one new class; (3) you want to replace a big if/else chain that chooses behavior.

কখন ব্যবহার করবে: (১) algorithm-টা runtime-এ বাছতে হলে — যেমন ছোট array → insertion sort, বিশাল array → merge sort; (২) পুরনো code-এ হাত না দিয়ে নতুন algorithm যোগ করতে চাইলে — এটাই Open/Closed principle: নতুন algorithm মানে শুধু একটা নতুন class; (৩) behavior বাছাই করা বড় if/else chain সরাতে চাইলে।

Real BUET question (April 2024): "Explain the Strategy design pattern with an example." The interface + two concrete strategy classes + context code above is a full-marks answer. Say the two magic phrases: swap the algorithm at runtime and Open/Closed principle.
Real BUET question (April 2024): "Strategy design pattern একটা example দিয়ে ব্যাখ্যা করো।" উপরের interface + দুইটা concrete strategy class + context code-ই full-marks উত্তর। দুইটা magic কথা বলতে ভুলো না: runtime-এ algorithm swap আর Open/Closed principle
Exam tip: Match pattern → purpose: Singleton = one instance; Factory = hide object creation; Observer = notify many on change; Strategy = swap algorithm at runtime. And remember the golden design rule in one breath: low coupling, high cohesion.
Exam tip: Pattern → কাজ মিলিয়ে রাখো: Singleton = একটাই instance; Factory = object বানানো লুকানো; Observer = change হলে অনেককে notify; Strategy = runtime-এ algorithm swap। আর design-এর golden rule এক নিঃশ্বাসে: low coupling, high cohesion।

6. Information Systems Design Basics6. Information Systems Design Basics

An Information System (IS) is a combination of people, hardware, software, data, and processes that collects, stores, processes, and delivers information to support decisions in an organization. Software is just one part — the people and business processes matter too.

Information System (IS) হলো people, hardware, software, data আর process-এর মিলিত রূপ, যা organization-এর decision-এ সাহায্য করার জন্য information সংগ্রহ, store, process আর deliver করে। Software এর মাত্র একটা অংশ — মানুষ আর business process-ও সমান জরুরি।

Types of IS — the pyramidIS-এর type — pyramid

Different levels of an organization use different systems. From bottom (daily operations) to top (strategy):

  • TPS (Transaction Processing System): records routine daily transactions — sales entry, ATM transactions, payroll, billing. Used by operational staff. Huge volume, simple decisions.
  • MIS (Management Information System): takes TPS data and produces regular summary reports (weekly sales report, monthly production report) for middle managers.
  • DSS (Decision Support System): interactive, model-based analysis for semi-structured decisions — "what happens to profit if we cut price 5%?". Used by managers/analysts.
  • ESS / EIS (Executive Support System): dashboards of key indicators plus external data (market trends) for TOP executives making long-term strategic decisions.

Organization-এর আলাদা level আলাদা system ব্যবহার করে। নিচ (দৈনন্দিন কাজ) থেকে উপরে (strategy):

  • TPS (Transaction Processing System): রোজকার routine transaction লেখে — sales entry, ATM transaction, payroll, billing। Operational staff-রা চালায়। বিশাল volume, simple decision।
  • MIS (Management Information System): TPS-এর data নিয়ে নিয়মিত summary report বানায় (সাপ্তাহিক sales report, মাসিক production report) — middle manager-দের জন্য।
  • DSS (Decision Support System): semi-structured decision-এর জন্য interactive, model-ভিত্তিক analysis — "দাম 5% কমালে profit-এর কী হবে?"। Manager/analyst-রা ব্যবহার করে।
  • ESS / EIS (Executive Support System): key indicator-এর dashboard + বাইরের data (market trend) — TOP executive-দের long-term strategic decision-এর জন্য।
ESS DSS MIS TPS Top executives strategic decisions Senior managers what-if analysis Middle managers summary reports Operational staff daily transactions
IS pyramid: TPS at the bottom feeds MIS; DSS and ESS support higher-level decisions.IS pyramid: নিচের TPS data দেয় MIS-কে; DSS আর ESS উপরের level-এর decision-এ সাহায্য করে।

Feasibility studyFeasibility study

Before starting a project, we check whether it is even worth doing. Main feasibility types:

  • Technical feasibility: can we build it with available technology and skills?
  • Economic feasibility: do the benefits beat the costs? (cost–benefit analysis)
  • Operational feasibility: will people actually use it? does it fit how the organization works?
  • Schedule feasibility: can we finish in the required time?
  • Legal feasibility: does it break any law or regulation (data privacy etc.)?

Project শুরুর আগে দেখা হয় এটা করা আদৌ ঠিক হবে কি না। মূল feasibility type:

  • Technical feasibility: হাতের technology আর skill দিয়ে বানানো যাবে?
  • Economic feasibility: লাভ কি খরচের চেয়ে বেশি? (cost–benefit analysis)
  • Operational feasibility: মানুষ আসলেই এটা ব্যবহার করবে? Organization-এর কাজের ধরনের সাথে মিলবে?
  • Schedule feasibility: দরকারি সময়ের মধ্যে শেষ করা যাবে?
  • Legal feasibility: কোনো আইন বা regulation (data privacy ইত্যাদি) ভাঙছে না তো?

Cost estimation: LOC, Function Points, COCOMOCost estimation: LOC, Function Points, COCOMO

How big/costly will the software be?

  • LOC (Lines of Code): estimate size in (kilo) lines of code. Simple, but depends on language and coding style, and is hard to guess early.
  • Function Points (FP): measure functionality instead of lines — count inputs, outputs, user inquiries, internal files, external interfaces, weight each by complexity, then adjust. Language-independent and usable early.
  • COCOMO (Constructive Cost Model), by Boehm: converts size (KLOC) into effort and time.

Basic COCOMO formulas:

Software কত বড়/কত খরচের হবে?

  • LOC (Lines of Code): size মাপা হয় (kilo) line of code-এ। Simple, কিন্তু language আর coding style-এর উপর নির্ভর করে, আর শুরুতে আন্দাজ করা কঠিন।
  • Function Points (FP): line না গুনে functionality মাপে — input, output, user inquiry, internal file, external interface গুনে complexity অনুযায়ী weight দিয়ে adjust করা হয়। Language-independent, আর শুরুর দিকেই ব্যবহার করা যায়।
  • COCOMO (Constructive Cost Model), Boehm-এর দেওয়া: size (KLOC) থেকে effort আর time বের করে।

Basic COCOMO-র formula:

\[ \text{Effort} = a \times (\text{KLOC})^{b} \ \text{person-months}, \qquad \text{Time} = c \times (\text{Effort})^{d} \ \text{months}, \qquad \text{Staff} = \frac{\text{Effort}}{\text{Time}} \]
Project typeProject type abcd Meaningমানে
Organic2.41.052.50.38Small team, familiar simple problemছোট team, চেনা simple problem
Semi-detached3.01.122.50.35Medium size, mixed experienceমাঝারি size, মিশ্র experience
Embedded3.61.202.50.32Tight hardware/rules constraints (e.g., avionics)কড়া hardware/নিয়মের constraint (যেমন avionics)
Example (COCOMO, organic, 32 KLOC):
  • Effort \(= 2.4 \times 32^{1.05} \approx 2.4 \times 38.0 \approx 91.3\) person-months.
  • Time \(= 2.5 \times 91.3^{0.38} \approx 2.5 \times 5.6 \approx 13.9\) months.
  • Average staff \(= 91.3 / 13.9 \approx 6.6 \approx 7\) people.
So roughly 7 people working about 14 months.
Example (COCOMO, organic, 32 KLOC):
  • Effort \(= 2.4 \times 32^{1.05} \approx 2.4 \times 38.0 \approx 91.3\) person-month।
  • Time \(= 2.5 \times 91.3^{0.38} \approx 2.5 \times 5.6 \approx 13.9\) month।
  • গড় staff \(= 91.3 / 13.9 \approx 6.6 \approx 7\) জন।
অর্থাৎ মোটামুটি ৭ জন প্রায় ১৪ মাস কাজ করবে।
Exam tip: In COCOMO questions, Effort is in person-months and Time in months — do not mix them up. Remember b grows with project difficulty (1.05 → 1.12 → 1.20): harder projects scale worse with size.
Exam tip: COCOMO-র প্রশ্নে Effort-এর unit person-month, আর Time-এর unit month — গুলিয়ে ফেলো না। মনে রাখো b বাড়ে project কঠিন হলে (1.05 → 1.12 → 1.20): কঠিন project size-এর সাথে বেশি খারাপভাবে বাড়ে।

Business Logic Design (Real Exam Question!)Business Logic Design (Real Exam Question!)

Business logic (also called domain logic) is the part of the software that encodes the REAL rules of the business: calculations, decisions, and workflows. It is NOT the UI (screens, buttons) and NOT the data access (SQL, files) — it is the "thinking" in between. Examples of business rules: "orders of 5000 Tk or more get a 10% discount", "a loan above 1 lakh needs manager approval", "stock can never go below zero".

Where it lives: in a 3-tier / layered design, business logic sits in the MIDDLE layer — the service layer / domain model — between the presentation (UI) layer and the data access layer. Kept there, you can change the UI or swap the database without rewriting the rules, and you can test the rules alone.

How it is implemented:

  • Service classes: one class per workflow — e.g., OrderService.placeOrder() runs validation, discount, and stock update as one unit.
  • Domain entities: objects like Order or Account carry their own small rules — e.g., order.subtotal() knows how to add its lines.
  • Rule engines / config: rules that change often (discount rates, limits) are stored as data, so they can be updated without redeploying code.

Business logic (domain logic-ও বলে) হলো software-এর সেই অংশ যেখানে business-এর আসল নিয়মগুলো থাকে: calculation, decision আর workflow। এটা UI না (screen, button), data access-ও না (SQL, file) — মাঝখানের "চিন্তা করা" অংশটা। Business rule-এর example: "৫০০০ টাকা বা তার বেশি order-এ 10% discount", "১ লাখের উপরে loan-এ manager-এর approval লাগবে", "stock কখনো শূন্যের নিচে যাবে না"।

কোথায় থাকে: 3-tier / layered design-এ business logic থাকে মাঝের layer-এ — service layer / domain model-এ — presentation (UI) layer আর data access layer-এর মাঝখানে। ওখানে রাখলে UI বদলালে বা database swap করলে নিয়মগুলো আবার লিখতে হয় না, আর নিয়মগুলো আলাদা করে test করা যায়।

কীভাবে implement হয়:

  • Service class: প্রতি workflow-র জন্য একটা class — যেমন OrderService.placeOrder() validation, discount আর stock update একসাথে চালায়।
  • Domain entity: Order বা Account-এর মতো object নিজের ছোট নিয়ম নিজে রাখে — যেমন order.subtotal() জানে তার line-গুলো কীভাবে যোগ হবে।
  • Rule engine / config: যেসব নিয়ম ঘন ঘন বদলায় (discount rate, limit), সেগুলো data হিসেবে রাখা হয়, যাতে code redeploy না করেই বদলানো যায়।
// 3-tier: UI layer -> business logic layer -> data access layer

class OrderService {                  // business logic (service layer)
    double totalPayable(Order o) {
        double sum = o.subtotal();    // domain entity does its own part
        if (sum >= 5000)
            sum = sum * 0.90;         // business RULE: 10% discount
        return sum;
    }
}
// The UI layer only DISPLAYS totalPayable().
// The data layer only SAVES the order.
// The rule lives in ONE place — change the discount, touch one line.
Real BUET question (October 2018): "What is business logic and how would you design it in an information system?" Full-marks answer: definition (rules/calculations/workflows), what it is NOT (UI, data access), where it lives (service layer / domain model in a 3-tier design), how it is implemented (service classes, domain entities, rule engines) — plus one small example like the discount rule above.
Real BUET question (October 2018): "Business logic কী, আর information system-এ এটা কীভাবে design করবে?" Full-marks উত্তর: definition (rule/calculation/workflow), এটা কী না (UI, data access), কোথায় থাকে (3-tier design-এর service layer / domain model), কীভাবে implement হয় (service class, domain entity, rule engine) — সাথে উপরের discount rule-এর মতো একটা ছোট example।

Practice Questions (Admission Style)Practice Questions (Admission Style)

Q1. Which phase of the SDLC normally comes FIRST?
  • (a) Design
  • (b) Coding
  • (c) Requirements analysis
  • (d) Testing
Q1. SDLC-র কোন phase সাধারণত সবার আগে আসে?
  • (a) Design
  • (b) Coding
  • (c) Requirements analysis
  • (d) Testing
Show Answerউত্তর দেখুন
Answer: (c) — You must know WHAT to build before deciding how (design), writing code, or testing. So requirements analysis starts the lifecycle.
Answer: (c) — কী বানাতে হবে সেটা না জানলে design, coding বা testing কিছুই করা যায় না। তাই lifecycle শুরু হয় requirements analysis দিয়ে।
Q2. The biggest drawback of the Waterfall model is:
  • (a) It has too many phases
  • (b) Working software comes only at the end, and changes are very hard
  • (c) It needs risk experts
  • (d) It requires daily meetings
Q2. Waterfall model-এর সবচেয়ে বড় সমস্যা কোনটা?
  • (a) Phase বেশি
  • (b) কাজ করা software একদম শেষে আসে, আর change করা খুব কঠিন
  • (c) Risk expert লাগে
  • (d) রোজ meeting লাগে
Show Answerউত্তর দেখুন
Answer: (b) — Waterfall is strictly linear: the customer sees a working product only after all phases finish, and going back to change requirements is very costly. (c) describes Spiral, (d) hints at Scrum.
Answer: (b) — Waterfall কড়াভাবে linear: সব phase শেষ হওয়ার পরেই customer কাজ করা product দেখে, আর পেছনে গিয়ে requirement বদলানো খুব খরচের। (c) হলো Spiral-এর কথা, (d) Scrum-এর ইঙ্গিত।
Q3. Which of the following is NOT a Scrum role?
  • (a) Product Owner
  • (b) Scrum Master
  • (c) Project Manager
  • (d) Development Team
Q3. নিচের কোনটা Scrum role না?
  • (a) Product Owner
  • (b) Scrum Master
  • (c) Project Manager
  • (d) Development Team
Show Answerউত্তর দেখুন
Answer: (c) — Scrum defines exactly three roles: Product Owner (what to build), Scrum Master (process coach), and the Development Team (how to build). There is no "Project Manager" role in Scrum; the team is self-organizing.
Answer: (c) — Scrum-এ ঠিক তিনটা role: Product Owner (কী বানাবে), Scrum Master (process-এর coach), আর Development Team (কীভাবে বানাবে)। Scrum-এ "Project Manager" বলে কোনো role নেই; team নিজেই self-organizing।
Q4. "The system must respond to any search within 2 seconds." This is a:
  • (a) Functional requirement
  • (b) Non-functional requirement
  • (c) Use case
  • (d) Design constraint on the database only
Q4. "System-কে যেকোনো search-এর জবাব ২ second-এর মধ্যে দিতে হবে।" এটা কী?
  • (a) Functional requirement
  • (b) Non-functional requirement
  • (c) Use case
  • (d) শুধু database-এর design constraint
Show Answerউত্তর দেখুন
Answer: (b) — It does not describe a feature; it says HOW WELL an existing feature (search) must perform. Performance numbers (response time, throughput, uptime) are classic non-functional requirements.
Answer: (b) — এটা কোনো feature-এর বর্ণনা না; বলছে একটা feature (search) কত ভালোভাবে কাজ করবে। Performance-এর number (response time, throughput, uptime) হলো classic non-functional requirement।
Q5. In a UML class diagram, a FILLED (black) diamond on a line means:
  • (a) Aggregation — part can exist without the whole
  • (b) Composition — part cannot exist without the whole
  • (c) Inheritance
  • (d) Dependency
Q5. UML class diagram-এ line-এর উপর FILLED (কালো) diamond মানে কী?
  • (a) Aggregation — whole ছাড়াও part থাকতে পারে
  • (b) Composition — whole ছাড়া part থাকতে পারে না
  • (c) Inheritance
  • (d) Dependency
Show Answerউত্তর দেখুন
Answer: (b) — Filled diamond = composition, a strong whole–part bond: delete the whole and the parts die too (House–Room). Hollow diamond = aggregation (Team–Player: player survives without the team). The diamond sits on the whole's side.
Answer: (b) — Filled diamond = composition, শক্ত whole–part বন্ধন: whole delete হলে part-ও শেষ (House–Room)। Hollow diamond = aggregation (Team–Player: team না থাকলেও player থাকে)। Diamond বসে whole-এর পাশে।
Q6. Boundary value analysis and equivalence partitioning are techniques of:
  • (a) White box testing
  • (b) Black box testing
  • (c) Regression testing
  • (d) Integration testing
Q6. Boundary value analysis আর equivalence partitioning কোনটার technique?
  • (a) White box testing
  • (b) Black box testing
  • (c) Regression testing
  • (d) Integration testing
Show Answerউত্তর দেখুন
Answer: (b) — Both techniques design tests from the INPUT specification only, without looking at the code. That is exactly black box testing. White box techniques are statement/branch/path coverage.
Answer: (b) — দুটো technique-ই শুধু INPUT-এর specification দেখে test বানায়, code না দেখে। এটাই black box testing। White box-এর technique হলো statement/branch/path coverage।
Q7. "Are we building the RIGHT product?" — this question defines:
  • (a) Verification
  • (b) Validation
  • (c) Unit testing
  • (d) Code review
Q7. "আমরা কি ঠিক product-টাই বানাচ্ছি?" — এই প্রশ্নটা কীসের definition?
  • (a) Verification
  • (b) Validation
  • (c) Unit testing
  • (d) Code review
Show Answerউত্তর দেখুন
Answer: (b) — Validation checks the product against the user's real needs ("right product"). Verification checks the work against the spec/design ("building the product right"), e.g., reviews and inspections.
Answer: (b) — Validation মেলায় product-কে user-এর আসল দরকারের সাথে ("ঠিক product")। Verification মেলায় কাজকে spec/design-এর সাথে ("ঠিকভাবে বানানো"), যেমন review আর inspection।
Q8. A class Report computes statistics, formats them as HTML, AND saves them to a database. Which SOLID principle does it break most directly?
  • (a) Liskov Substitution
  • (b) Interface Segregation
  • (c) Single Responsibility
  • (d) Dependency Inversion
Q8. একটা Report class statistics হিসাব করে, HTML-এ format করে, আবার database-এও save করে। এটা সবচেয়ে সরাসরি কোন SOLID principle ভাঙছে?
  • (a) Liskov Substitution
  • (b) Interface Segregation
  • (c) Single Responsibility
  • (d) Dependency Inversion
Show Answerউত্তর দেখুন
Answer: (c) — The class has three separate reasons to change: the statistics logic, the HTML format, and the storage method. Single Responsibility says a class should have only ONE reason to change, so it should be split into three classes.
Answer: (c) — Class-টার বদলানোর তিনটা আলাদা কারণ আছে: statistics-এর logic, HTML format, আর storage-এর ধরন। Single Responsibility বলে একটা class-এর বদলানোর কারণ একটাই হবে, তাই এটাকে তিনটা class-এ ভাগ করা উচিত।
Q9. Which information system is designed mainly for TOP executives making long-term strategic decisions?
  • (a) TPS
  • (b) MIS
  • (c) DSS
  • (d) ESS
Q9. Long-term strategic decision নেওয়া TOP executive-দের জন্য মূলত কোন information system?
  • (a) TPS
  • (b) MIS
  • (c) DSS
  • (d) ESS
Show Answerউত্তর দেখুন
Answer: (d) — ESS (Executive Support System) sits at the top of the IS pyramid: dashboards of key indicators plus external data for strategy. TPS = daily transactions (bottom), MIS = summary reports for middle managers, DSS = what-if analysis.
Answer: (d) — ESS (Executive Support System) IS pyramid-এর একদম উপরে: key indicator-এর dashboard + বাইরের data, strategy-র জন্য। TPS = রোজকার transaction (নিচে), MIS = middle manager-দের summary report, DSS = what-if analysis।
Q10. (Written) A government tax office wants software. The requirements are fully written in law and will not change; the office demands complete documents at every stage and very strict testing. Which process model do you choose? Justify with at least 3 points.
Q10. (Written) একটা সরকারি tax office software চায়। Requirement পুরোটাই আইনে লেখা, বদলাবে না; office প্রতিটা stage-এ পুরো document আর খুব কড়া testing চায়। কোন process model নেবে? অন্তত ৩টা point দিয়ে justify করো।
Show Answerউত্তর দেখুন
Answer: Waterfall (or V-model). Reasoning: (1) Requirements are fixed by law and fully known up front — Waterfall's biggest weakness (changing requirements) does not apply. (2) Waterfall naturally produces a complete document at the end of each phase, which the office demands. (3) For the strict-testing demand, the V-model variant is even better: each development phase gets a matching, pre-planned test phase (requirements ↔ acceptance test, design ↔ system test). (4) Agile/prototyping would waste effort here: there is no unclear requirement to explore and no customer who wants sprint-by-sprint change.
Answer: Waterfall (বা V-model)। কারণ: (1) Requirement আইনে fixed আর শুরু থেকেই পুরো জানা — Waterfall-এর বড় দুর্বলতা (requirement বদলানো) এখানে খাটে না। (2) Waterfall প্রতিটা phase শেষে পুরো document দেয়, যেটা office চায়। (3) কড়া testing-এর জন্য V-model আরও ভালো: প্রতিটা development phase-এর সাথে আগে থেকে plan করা matching test phase থাকে (requirements ↔ acceptance test, design ↔ system test)। (4) Agile/prototyping এখানে effort নষ্ট করত: অস্পষ্ট requirement-ও নেই, sprint-এ sprint-এ change চাওয়া customer-ও নেই।
Q11. (Written) Write the use case "Borrow Book" for a library system: actors, precondition, numbered main flow, one alternate flow, postcondition.
Q11. (Written) Library system-এর জন্য "Borrow Book" use case লেখো: actor, precondition, number করা main flow, একটা alternate flow, postcondition।
Show Answerউত্তর দেখুন
Answer (model solution):
  • Actors: Member (primary), Librarian (primary).
  • Precondition: Member has a valid membership; the book copy exists in the library.
  • Main flow: 1. Member brings the book to the desk. 2. Librarian scans the member card; system shows the member's record. 3. Librarian scans the book; system checks the member's limit (max 3 books) and any unpaid fines. 4. System records the loan with a 14-day due date. 5. System marks the copy "borrowed" and prints a due-date slip.
  • Alternate flow A1 (limit reached): At step 3, if the member already holds 3 books, the system rejects the loan and shows the list of books to return; use case ends.
  • Postcondition: Loan is stored; book copy is marked unavailable to others.
The key marks: named actors, numbered steps, a real alternate flow with its trigger and outcome, and a state-changing postcondition.
Answer (model solution):
  • Actor: Member (primary), Librarian (primary)।
  • Precondition: Member-এর valid membership আছে; বইয়ের copy library-তে আছে।
  • Main flow: 1. Member বইটা desk-এ আনে। 2. Librarian member card scan করে; system member-এর record দেখায়। 3. Librarian বই scan করে; system member-এর limit (সর্বোচ্চ ৩টা বই) আর বাকি fine check করে। 4. System ১৪ দিনের due date দিয়ে loan record করে। 5. System copy-টাকে "borrowed" mark করে due-date slip print করে।
  • Alternate flow A1 (limit শেষ): Step 3-এ member-এর কাছে আগেই ৩টা বই থাকলে system loan reject করে ফেরত দেওয়ার বইয়ের list দেখায়; use case শেষ।
  • Postcondition: Loan save হয়েছে; বইয়ের copy অন্যদের জন্য unavailable।
নম্বর ওঠে: actor-এর নাম, number করা step, trigger আর ফলাফলসহ আসল alternate flow, আর state বদলানো postcondition-এ।
Q12. (Written) An age field accepts integers 18 to 60 (inclusive). (i) List the equivalence partitions with one test value each. (ii) List the boundary value analysis test values. (iii) How many test cases in total for the standard 6-value BVA?
Q12. (Written) একটা age field 18 থেকে 60 (inclusive) integer নেয়। (i) Equivalence partition গুলো আর প্রতিটা থেকে একটা করে test value লেখো। (ii) Boundary value analysis-এর test value গুলো লেখো। (iii) Standard 6-value BVA-তে মোট কয়টা test case?
Show Answerউত্তর দেখুন
Answer: (i) Three partitions: invalid low (age < 18, e.g., 10), valid (18–60, e.g., 35), invalid high (age > 60, e.g., 70). One value per partition is enough because all values in a partition should behave the same. (ii) Boundaries are 18 and 60, so test 17, 18, 19 and 59, 60, 61. (iii) 6 test cases (17, 18, 19, 59, 60, 61). 17 and 61 must be REJECTED; 18, 19, 59, 60 must be ACCEPTED — off-by-one bugs (writing > 18 instead of >= 18) are caught exactly here.
Answer: (i) তিনটা partition: invalid low (age < 18, যেমন 10), valid (18–60, যেমন 35), invalid high (age > 60, যেমন 70)। প্রতি partition থেকে একটা value-ই যথেষ্ট, কারণ এক partition-এর সব value-র behavior একই হওয়ার কথা। (ii) Boundary হলো 18 আর 60, তাই test করো 17, 18, 19 আর 59, 60, 61। (iii) ৬টা test case (17, 18, 19, 59, 60, 61)। 17 আর 61 REJECT হতে হবে; 18, 19, 59, 60 ACCEPT হতে হবে — off-by-one bug (>= 18-এর জায়গায় > 18 লেখা) ঠিক এখানেই ধরা পড়ে।
Q13. (Written) For the code below, find the MINIMUM number of test cases for (i) statement coverage, (ii) branch coverage, (iii) path coverage. Give example inputs.
void f(int x, int y) {
    if (x > 0)  print("A");   // D1
    if (y > 0)  print("B");   // D2
    print("done");
}
Q13. (Written) নিচের code-এর জন্য (i) statement coverage, (ii) branch coverage, (iii) path coverage-এর MINIMUM test case সংখ্যা বের করো। Example input দাও।
void f(int x, int y) {
    if (x > 0)  print("A");   // D1
    if (y > 0)  print("B");   // D2
    print("done");
}
Show Answerউত্তর দেখুন
Answer: (i) Statement coverage: 1 test — (x=1, y=1) makes both ifs true, so every print runs. (ii) Branch coverage: 2 tests — (1,1) gives D1 true, D2 true; (−1,−1) gives D1 false, D2 false. Every branch has now gone both ways. (iii) Path coverage: paths are TT, TF, FT, FF → 4 tests, e.g., (1,1), (1,−1), (−1,1), (−1,−1). Note the ordering: statement ≤ branch ≤ path — each level is stronger and needs more tests.
Answer: (i) Statement coverage: টা test — (x=1, y=1)-এ দুটো if-ই true, সব print চলে। (ii) Branch coverage: টা test — (1,1)-এ D1 true, D2 true; (−1,−1)-এ D1 false, D2 false। প্রতিটা branch দুই দিকেই গেছে। (iii) Path coverage: path হলো TT, TF, FT, FF → টা test, যেমন (1,1), (1,−1), (−1,1), (−1,−1)। মনে রাখো: statement ≤ branch ≤ path — প্রতিটা level আগেরটার চেয়ে শক্ত, test-ও বেশি লাগে।
Q14. (Written) A semi-detached project is estimated at 50 KLOC. Using basic COCOMO (a=3.0, b=1.12, c=2.5, d=0.35), compute the effort, the development time, and the average staff size.
Q14. (Written) একটা semi-detached project-এর size ধরা হয়েছে 50 KLOC। Basic COCOMO (a=3.0, b=1.12, c=2.5, d=0.35) দিয়ে effort, development time আর গড় staff size বের করো।
Show Answerউত্তর দেখুন
Answer:
  • Effort \(= 3.0 \times 50^{1.12}\). Since \(50^{1.12} \approx 79.9\), Effort \(\approx 3.0 \times 79.9 \approx 240\) person-months.
  • Time \(= 2.5 \times 240^{0.35} \approx 2.5 \times 6.8 \approx 17\) months.
  • Average staff \(= 240 / 17 \approx 14\) people.
Reasoning: effort scales super-linearly with size (b > 1), and time grows much more slowly than effort (d = 0.35), so bigger projects need MORE people rather than proportionally more months.
Answer:
  • Effort \(= 3.0 \times 50^{1.12}\)। যেহেতু \(50^{1.12} \approx 79.9\), Effort \(\approx 3.0 \times 79.9 \approx 240\) person-month।
  • Time \(= 2.5 \times 240^{0.35} \approx 2.5 \times 6.8 \approx 17\) month।
  • গড় staff \(= 240 / 17 \approx 14\) জন।
কারণ: size বাড়লে effort তার চেয়ে দ্রুত বাড়ে (b > 1), কিন্তু time বাড়ে effort-এর চেয়ে অনেক ধীরে (d = 0.35) — তাই বড় project-এ মাস proportionally না বাড়িয়ে মানুষ বেশি লাগে।
Q15. (Written) A module Utils contains date formatting, tax calculation, and email sending. It also reads a global variable appConfig that five other modules write to. (i) Name the cohesion type of Utils and the coupling type caused by appConfig. (ii) Explain why this design is bad. (iii) Propose a better design.
Q15. (Written) একটা module Utils-এ আছে date formatting, tax calculation আর email পাঠানো। সে আবার একটা global variable appConfig পড়ে, যেটায় আরও পাঁচটা module লেখে। (i) Utils-এর cohesion type আর appConfig-এর কারণে হওয়া coupling type-এর নাম বলো। (ii) এই design খারাপ কেন, ব্যাখ্যা করো। (iii) আরও ভালো design প্রস্তাব করো।
Show Answerউত্তর দেখুন
Answer: (i) Utils has coincidental cohesion (the worst kind — unrelated tasks lumped together). The shared global appConfig creates common coupling. (ii) It is bad because: a change to tax rules forces retesting date and email code too; the module cannot be reused (who wants tax + email together?); and with common coupling, ANY of the six modules writing appConfig can silently break the others — bugs become very hard to trace. (iii) Better: split into three functionally cohesive modules — DateFormatter, TaxCalculator, EmailSender — and remove the global: pass each module only the config values it needs as parameters (data coupling), or inject a read-only config object through its constructor. Result: low coupling, high cohesion — the stated goal of good design.
Answer: (i) Utils-এর cohesion হলো coincidental cohesion (সবচেয়ে খারাপ — সম্পর্কহীন কাজ এক জায়গায়)। Shared global appConfig বানায় common coupling। (ii) খারাপ কারণ: tax-এর নিয়ম বদলালে date আর email-এর code-ও আবার test করতে হয়; module-টা reuse করা যায় না (tax + email একসাথে কে চায়?); আর common coupling-এ appConfig-এ লেখা ছয়টা module-এর যে কেউ চুপিচুপি বাকিদের ভাঙতে পারে — bug খুঁজে পাওয়া খুব কঠিন হয়। (iii) ভালো design: তিনটা functionally cohesive module-এ ভাগ করো — DateFormatter, TaxCalculator, EmailSender — আর global সরাও: প্রতিটা module-কে শুধু তার দরকারি config value parameter হিসেবে দাও (data coupling), বা constructor দিয়ে read-only config object inject করো। ফলাফল: low coupling, high cohesion — ভালো design-এর আসল goal।
Q16. (Written, Real exam style — April 2024) Mention the reasons for the failure of a software project. Give at least six reasons with a one-line explanation for each.
Q16. (Written, Real exam style — April 2024) একটা software project fail করার কারণগুলো লেখো। অন্তত ছয়টা কারণ, প্রতিটার সাথে এক লাইনের ব্যাখ্যা দাও।
Show Answerউত্তর দেখুন
Answer (model solution):
  1. Unclear or changing requirements — the team builds the wrong thing because nobody pinned down what was needed, or the target kept shifting.
  2. Poor estimation of time and cost — an over-optimistic schedule/budget guarantees the project looks "failed" even if the work is fine.
  3. Lack of user involvement — without user feedback during development, the delivered product does not fit real work, so users reject it.
  4. Poor communication — customer, managers, and developers each imagine a different product; the gaps surface only at delivery.
  5. Inadequate testing — rushed or skipped testing sends bugs to production, destroying user trust.
  6. Scope creep — features keep getting added without adding time or people, so nothing gets finished properly.
  7. Weak project management — no clear plan or progress tracking means problems are noticed too late to fix.
  8. No risk management — nobody asked "what can go wrong?" early, so predictable problems (key person leaves, technology fails) arrive as surprises.
Any six of these, each with its one-line "why", is a full-marks answer. Tip: start with requirements-related reasons — they cause the most failures.
Answer (model solution):
  1. Unclear বা changing requirements — কী দরকার তা কেউ পাকা করেনি বা target সরতে থেকেছে, তাই team ভুল জিনিস বানায়।
  2. Time আর cost-এর poor estimation — বেশি আশাবাদী schedule/budget থাকলে কাজ ভালো হলেও project-টা "failed" দেখায়।
  3. User involvement-এর অভাব — development-এর সময় user-এর feedback না নিলে delivered product আসল কাজের সাথে মেলে না, user-রা নেয় না।
  4. Poor communication — customer, manager আর developer-রা যে যার মতো আলাদা product কল্পনা করে; ফারাকটা ধরা পড়ে delivery-তে।
  5. Inadequate testing — তাড়াহুড়ার বা বাদ দেওয়া testing bug-কে production-এ পাঠায়, user-এর বিশ্বাস নষ্ট হয়।
  6. Scope creep — সময় বা মানুষ না বাড়িয়ে feature যোগ হতে থাকে, কিছুই ঠিকমতো শেষ হয় না।
  7. Weak project management — clear plan আর progress tracking না থাকলে সমস্যা এত দেরিতে চোখে পড়ে যে ঠিক করা যায় না।
  8. Risk management নেই — শুরুতে "কী ভুল হতে পারে?" কেউ ভাবেনি, তাই আন্দাজ করা যেত এমন সমস্যাও (key person চলে যাওয়া, technology fail) surprise হয়ে আসে।
এর যেকোনো ছয়টা, প্রতিটার সাথে এক লাইনের "কেন" — এটাই full-marks answer। Tip: requirements-এর কারণগুলো দিয়ে শুরু করো — সবচেয়ে বেশি failure ওখান থেকেই।
Q17. (Written, Real exam style — April 2019) (i) Name the four types of software maintenance and give one example of each. (ii) List, in order, the six phases of the Software Maintenance Life Cycle (SMLC) with one line about each phase.
Q17. (Written, Real exam style — April 2019) (i) Software maintenance-এর চারটা type-এর নাম আর প্রতিটার একটা করে example দাও। (ii) Software Maintenance Life Cycle (SMLC)-এর ছয়টা phase order অনুযায়ী লেখো, প্রতিটা নিয়ে এক লাইন।
Show Answerউত্তর দেখুন
Answer: (i) Four maintenance types:
  • Corrective — fixing bugs found after release. Example: login crashes on a special character in the password.
  • Adaptive — adjusting to a changed environment. Example: updating billing because the VAT rate changed, or porting to a new OS.
  • Perfective — improving for users. Example: adding a requested dark mode, making search faster.
  • Preventive — cleaning up now to avoid future problems. Example: refactoring a messy module and updating its documentation.
(ii) The six SMLC phases in order:
  1. Identification — receive change requests and identify what modification is needed.
  2. Analysis — study the feasibility, impact, and cost of the change.
  3. Design — design the modification using the current system's documents.
  4. Implementation — code the change into the system.
  5. System testing — test the change plus regression tests so old features still work.
  6. Delivery — release the updated software to the users.
Reasoning to remember the order: it mirrors a mini-SDLC — find the change, study it, design it, build it, test it, ship it.
Answer: (i) চারটা maintenance type:
  • Corrective — release-এর পরে পাওয়া bug ঠিক করা। Example: password-এ special character থাকলে login crash করে।
  • Adaptive — বদলে যাওয়া environment-এর সাথে মানানো। Example: VAT rate বদলানোয় billing update করা, বা নতুন OS-এ port করা।
  • Perfective — user-দের জন্য ভালো করা। Example: চাওয়া dark mode যোগ করা, search আরও fast করা।
  • Preventive — ভবিষ্যতের সমস্যা এড়াতে এখনই পরিষ্কার করা। Example: এলোমেলো module refactor করে documentation update করা।
(ii) SMLC-র ছয়টা phase, order অনুযায়ী:
  1. Identification — change request নেওয়া আর কী modification লাগবে তা identify করা।
  2. Analysis — change-টার feasibility, impact আর cost study করা।
  3. Design — চালু system-এর document দেখে modification design করা।
  4. Implementation — change-টা system-এ code করা।
  5. System testing — change test করা + regression test, যাতে পুরনো feature ঠিক থাকে।
  6. Delivery — updated software user-দের কাছে release করা।
Order মনে রাখার উপায়: এটা একটা ছোট SDLC-র মতো — change খোঁজো, study করো, design করো, বানাও, test করো, ship করো।
Q18. (Written, Real exam style — April 2024) A program must sort data. Small inputs should use one algorithm and very large inputs another, and the choice can change while the program runs. (i) Name the design pattern that fits and say what problem it solves. (ii) Sketch the design in code: one interface, two concrete algorithm classes, and a context class. (iii) When a third algorithm is added later, which SOLID principle does this design follow?
Q18. (Written, Real exam style — April 2024) একটা program-কে data sort করতে হবে। ছোট input-এ এক algorithm, খুব বড় input-এ আরেকটা — আর program চলার সময়েই এই choice বদলাতে পারে। (i) কোন design pattern মানানসই, আর সেটা কোন problem solve করে? (ii) Code-এ design-টা আঁকো: একটা interface, দুইটা concrete algorithm class, আর একটা context class। (iii) পরে তৃতীয় একটা algorithm যোগ করলে এই design কোন SOLID principle মানে?
Show Answerউত্তর দেখুন
Answer: (i) The Strategy pattern (behavioral). Problem it solves: a family of interchangeable algorithms must be selected and swapped at runtime, without the client code changing and without a big if/else chain. (ii) Design:
interface SortStrategy { void sort(int[] a); }

class QuickSort implements SortStrategy {
    public void sort(int[] a) { /* quicksort */ }
}
class MergeSort implements SortStrategy {
    public void sort(int[] a) { /* mergesort */ }
}

class Sorter {                         // context
    private SortStrategy strategy;
    Sorter(SortStrategy s) { strategy = s; }
    void setStrategy(SortStrategy s) { strategy = s; }
    void sortData(int[] a) { strategy.sort(a); }
}
The context (Sorter) holds a reference to the interface only — it never knows which concrete algorithm it is running. Calling setStrategy(new MergeSort()) switches the algorithm at runtime. (iii) The Open/Closed principle: adding HeapSort implements SortStrategy is a NEW class only — no old code (Sorter, QuickSort, MergeSort) is modified. It also shows low coupling: Sorter depends on an abstraction, not on concrete classes (Dependency Inversion helps here too, but Open/Closed is the main answer).
Answer: (i) Strategy pattern (behavioral)। যে problem solve করে: একগুচ্ছ অদল-বদলযোগ্য algorithm-কে runtime-এ বাছাই আর swap করতে হবে — client code না বদলে, আর বড় if/else chain ছাড়া। (ii) Design:
interface SortStrategy { void sort(int[] a); }

class QuickSort implements SortStrategy {
    public void sort(int[] a) { /* quicksort */ }
}
class MergeSort implements SortStrategy {
    public void sort(int[] a) { /* mergesort */ }
}

class Sorter {                         // context
    private SortStrategy strategy;
    Sorter(SortStrategy s) { strategy = s; }
    void setStrategy(SortStrategy s) { strategy = s; }
    void sortData(int[] a) { strategy.sort(a); }
}
Context (Sorter) শুধু interface-এর reference রাখে — কোন concrete algorithm চলছে সে জানেই না। setStrategy(new MergeSort()) ডাকলেই runtime-এ algorithm বদলে যায়। (iii) Open/Closed principle: HeapSort implements SortStrategy যোগ করা মানে শুধু একটা NEW class — পুরনো code (Sorter, QuickSort, MergeSort) একটুও বদলাতে হয় না। এতে low coupling-ও দেখা যায়: Sorter concrete class না, abstraction-এর উপর নির্ভর করে (Dependency Inversion-ও এখানে কাজ করে, তবে মূল উত্তর Open/Closed)।
Q19. (Written, Real exam style — October 2018) In an information system design, what is "business logic"? Where should it be placed in a 3-tier architecture, and why? Describe two ways to implement it, with one small example rule.
Q19. (Written, Real exam style — October 2018) Information system design-এ "business logic" কী? 3-tier architecture-এ এটা কোথায় রাখা উচিত, আর কেন? এটা implement করার দুইটা উপায় বর্ণনা করো, সাথে একটা ছোট example rule দাও।
Show Answerউত্তর দেখুন
Answer: Business logic is the part of the software that encodes the real rules of the business — its calculations, decisions, and workflows (e.g., how a discount is computed, when an order is allowed). It is neither the UI (which only shows and collects data) nor the data access code (which only stores and fetches data) — it is the decision-making layer in between. Placement: in a 3-tier architecture it belongs in the MIDDLE tier — the service layer / domain model — between presentation and data access. Why there: (1) the rules stay in ONE place, so a rule change touches one spot; (2) the UI or the database can be replaced without rewriting the rules; (3) the rules can be unit-tested alone, without screens or a real database. Two implementations: (a) service classes — e.g., OrderService.totalPayable(order) applies the rule "orders of 5000 Tk or more get 10% off": if (sum >= 5000) sum *= 0.90; — the UI only displays the result, the data layer only saves the order; (b) domain entities — the Order object itself carries small rules like subtotal(). (A third option for frequently changing rules: a rule engine/config, so rates and limits are data, not code.)
Answer: Business logic হলো software-এর সেই অংশ যেখানে business-এর আসল নিয়ম থাকে — তার calculation, decision আর workflow (যেমন discount কীভাবে হিসাব হবে, কখন order allow হবে)। এটা UI না (UI শুধু data দেখায় আর নেয়), data access code-ও না (সেটা শুধু data রাখে আর আনে) — মাঝখানের decision নেওয়ার layer-টা। কোথায় রাখবে: 3-tier architecture-এ মাঝের tier-এ — service layer / domain model-এ — presentation আর data access-এর মাঝখানে। কেন সেখানে: (১) নিয়মগুলো এক জায়গায় থাকে, তাই rule বদলালে এক জায়গাতেই হাত দিতে হয়; (২) নিয়ম আবার না লিখেই UI বা database বদলানো যায়; (৩) screen বা আসল database ছাড়াই নিয়মগুলো আলাদা করে unit-test করা যায়। দুইটা implementation: (a) service class — যেমন OrderService.totalPayable(order) এই rule চালায়: "৫০০০ টাকা বা বেশি order-এ 10% ছাড়" → if (sum >= 5000) sum *= 0.90; — UI শুধু ফলাফল দেখায়, data layer শুধু order save করে; (b) domain entityOrder object নিজেই subtotal()-এর মতো ছোট নিয়ম রাখে। (ঘন ঘন বদলানো নিয়মের জন্য তৃতীয় উপায়: rule engine/config — rate আর limit তখন code না, data।)