Show 25 50 100
PDF
11 result(s) in Software Engineering Clear

Index

Showing 11 topics
  1. Software Engineering and SDLC
  2. Waterfall Model
  3. Agile and Scrum
  4. Other SDLC Models
  5. Requirements Engineering
  6. Software Testing
  7. UML Diagrams
  8. Coupling and Cohesion
  9. Design Patterns
  10. Software Metrics and Estimation
  11. Git and Version Control
1 Index

Software engineering is the systematic, disciplined approach to developing, operating and maintaining software. The SDLC (Software Development Life Cycle) is the series of phases a project goes through.

The seven SDLC phases

The seven SDLC phases

PhaseOutput
PlanningFeasibility study, cost and time estimate
Requirement analysisSRS (Software Requirements Specification)
DesignArchitecture, database design, UI design (HLD / LLD)
ImplementationSource code
TestingBug reports, tested build
DeploymentReleased product
MaintenanceBug fixes, updates, enhancements

Q & A

  1. What is software crisis?
    The problems of the 1960s-70s where projects went over budget, were late, unreliable and hard to maintain, which led to software engineering as a discipline.
2 Index

A linear, sequential model: each phase must finish before the next begins.

Phases flow down like a waterfall

Phases flow down like a waterfall

AdvantagesDisadvantages
Simple and easy to manageHard to go back and change requirements
Clear milestones and documentationWorking software only at the end
Good for small projects with fixed, clear requirementsHigh risk for large or changing projects
3 Index

Agile builds software in short iterations, delivering working software often and welcoming changing requirements.

Agile Manifesto values:

  • Individuals and interactions over processes and tools
  • Working software over comprehensive documentation
  • Customer collaboration over contract negotiation
  • Responding to change over following a plan

Product backlog → sprint → increment

Product backlog → sprint → increment

Artifacts: Product Backlog, Sprint Backlog, Increment. Events: Sprint Planning, Daily Scrum, Sprint Review, Sprint Retrospective. Requirements are written as user stories: "As a <user>, I want <goal> so that <reason>".

Q & A

  1. Agile vs Waterfall?
    Waterfall: sequential, fixed requirements, delivery at the end, heavy documentation. Agile: iterative, requirements can change, frequent delivery, continuous customer feedback.
  2. Scrum vs Kanban?
    Scrum uses fixed-length sprints and defined roles. Kanban is a continuous flow on a board (To Do → Doing → Done) with limits on work in progress.
4 Index
ModelIdeaBest for
Iterative / IncrementalBuild the system in small parts, each adding featuresLarge projects with clear core needs
SpiralIterations with risk analysis in every loop (Plan → Risk → Engineer → Evaluate)Large, high-risk projects
V-ModelWaterfall where every development phase has a matching test phaseSafety-critical systems
PrototypeBuild a quick model to understand requirements, then the real systemUnclear requirements
RADRapid development with reusable components and user feedbackShort deadlines
DevOpsDevelopment + operations, CI/CD automationFrequent releases
5 Index
Functional requirementsNon-functional requirements
What the system should doHow well the system should do it
User can log in, place an order, download a reportPerformance, security, usability, reliability, scalability
Tested with feature testsMeasured with metrics (response < 2 s, 99.9% uptime)

Steps: elicitation (interviews, surveys, observation) → analysis → specification (SRS) → validation → management.

A good SRS is correct, complete, unambiguous, consistent, verifiable and traceable.

6 Index

Unit → Integration → System → Acceptance

Unit → Integration → System → Acceptance

Black box testingWhite box testing
Tests behaviour without seeing the codeTests internal code, paths and logic
Done by testersDone by developers
Equivalence partitioning, boundary value analysisStatement, branch and path coverage
  • Regression testing — re-test after a change to make sure nothing old broke.
  • Smoke testing — quick check that the main features work in a new build.
  • Alpha testing (inside the company) vs Beta testing (real users).
  • Verification = are we building the product right? Validation = are we building the right product?
A tiny unit test C++ 8 lines
// Function under test
int maxOf(int a, int b) { return a > b ? a : b; }

// Unit tests (boundary and normal cases)
assert(maxOf(3, 5) == 5);
assert(maxOf(5, 3) == 5);
assert(maxOf(-1, -1) == -1);
assert(maxOf(INT_MAX, 0) == INT_MAX);

Q & A

  1. What is boundary value analysis?
    Testing at the edges of valid ranges. For an age field 18–60, test 17, 18, 19, 59, 60 and 61, because bugs often hide at boundaries.
  2. Error vs defect vs failure?
    Error: a human mistake. Defect (bug): the fault in the code caused by it. Failure: the wrong behaviour seen when the defective code runs.
7 Index

UML (Unified Modeling Language) is a standard way to visualise a system design.

StructuralBehavioural
Class diagram — classes, attributes, methods, relationshipsUse case diagram — actors and what they can do
Object diagram — objects at one momentSequence diagram — messages between objects over time
Component diagramActivity diagram — workflow, like a flowchart
Deployment diagram — hardware nodesState machine diagram — states of an object
  • Class relationships: association (line), inheritance (hollow triangle), aggregation (hollow diamond), composition (filled diamond), dependency (dashed arrow).
  • Visibility: + public, - private, # protected.
8 Index

Good design has low coupling and high cohesion.

CouplingCohesion
How much modules depend on each otherHow closely the parts inside one module belong together
Want it LOWWant it HIGH
Worst: content coupling; best: data couplingWorst: coincidental; best: functional

Low coupling means a change in one module rarely breaks another; high cohesion means each module has one clear job.

9 Index
CategoryPatterns
Creational (object creation)Singleton, Factory, Abstract Factory, Builder, Prototype
Structural (composition)Adapter, Decorator, Facade, Proxy, Composite
Behavioural (communication)Observer, Strategy, Command, Iterator, State
Singleton: exactly one object C++ 13 lines
class Database {
private:
    Database() {}                          // no outside construction
public:
    static Database& instance() {
        static Database db;                // created once, thread-safe (C++11)
        return db;
    }
    Database(const Database&) = delete;    // no copies
    void operator=(const Database&) = delete;
};

Database &db = Database::instance();
Factory: hide which class is created C++ 9 lines
class Shape { public: virtual void draw() = 0; virtual ~Shape() {} };
class Circle : public Shape { public: void draw() override { cout << "Circle\n"; } };
class Square : public Shape { public: void draw() override { cout << "Square\n"; } };

unique_ptr<Shape> createShape(const string &type) {   // factory
    if (type == "circle") return make_unique<Circle>();
    return make_unique<Square>();
}
createShape("circle")->draw();
Observer: notify all subscribers C++ 8 lines
class Observer { public: virtual void update(const string &msg) = 0; };

class Channel {
    vector<Observer*> subs;
public:
    void subscribe(Observer *o) { subs.push_back(o); }
    void publish(const string &msg) { for (auto *o : subs) o->update(msg); }
};
10 Index
  • LOC — lines of code (simple size measure).
  • Function Point — size by inputs, outputs, inquiries, files and interfaces (language independent).
  • Cyclomatic complexity = E − N + 2 (edges − nodes + 2) = number of decisions + 1; the number of independent paths to test.
  • COCOMO — estimates effort: Effort = a × (KLOC)b person-months (organic, semi-detached, embedded).
11 Index

Version control records every change so a team can work together, review history and roll back. Git is distributed: every developer has the full history.

Bash / Shell 12 lines
git init                       # new repository
git clone <url>                # copy a remote repository
git status                     # what changed
git add .                      # stage changes
git commit -m "Add login page" # save a snapshot
git log --oneline              # history
git branch feature-x           # create a branch
git checkout -b feature-x      # create and switch
git merge feature-x            # merge into the current branch
git pull                       # fetch + merge from remote
git push origin main           # upload commits
git revert <commit>            # undo a commit with a new commit

merge keeps both histories with a merge commit; rebase replays your commits on top of another branch for a straight history.