Introduction to Software Engineering


Introduction to Software Engineering

Simon
Many people can code to some degree. They might be self-taught, have taken a crash course or boot camp, or studied computing for four years. But coding ability alone does not automatically make someone a professional software developer. The key distinction is software engineering: a standardized, structured, and thorough approach to the entire development process.

Anna
So software engineering is not just about writing code that works once. It is about treating development as a process, from understanding the customer’s needs all the way through planning, development, testing, deployment, and later improvements.

Simon
Exactly. Formalizing the process matters for several reasons. First, professionals need to build the correct product—the one the customer actually wants. Second, the code needs to follow standards so it can be maintained over months or years and understood by a team. Third, the software needs rigor: it should be correct, efficient, and secure, and software engineering provides techniques that increase our confidence in those qualities.

Anna
And the first major stage begins before development: requirements gathering. A hobbyist might jump straight into coding and hope the idea becomes clear along the way. In a professional project, that is risky because building the wrong product wastes a great deal of time.

Simon
The obvious approach is to ask the customer for a list of requirements, but that list can be long, unclear, or not especially useful to programmers. Customers may not even know exactly what they want. So developers use structured methods such as surveys, interviews, and focus groups to gather information and clarify needs.

Anna
Another useful method is observation. If an existing software system is available, developers can watch users work with it. They can identify the users’ habits and pain points, then use those observations to design a better program.

Simon
One especially important technique is use case analysis. A use case describes a real usage scenario from the user’s point of view, rather than from the programmer’s point of view. It normally includes a main success scenario written as a series of clear, descriptive steps, without technical jargon.

Anna
For example, in a sales system, a use case for adding a sale might say: initiate the action, enter the sale name and quantity, and store that information in the system. That sequence describes what happens when everything goes correctly—the main success scenario.

Simon
Use cases also describe alternative and error scenarios. If the user enters a quantity less than one, the system might display an error and return to the step where the quantity is entered. A use case can also specify preconditions—the facts that must be true before the scenario begins—and postconditions, which describe what happens at the end.

Anna
There are also user stories. They are usually less detailed than use cases, but they put us firmly in the user’s shoes. A good user story states who the user is, what they want to do, and why they want to do it. That reason is particularly useful because it may not be explicit in a more detailed use case.

Simon
Once requirements have been gathered, they need to be analyzed. Two important categories are functional and non-functional requirements. A functional requirement says what the system must do, such as storing a sale or allowing a user to edit a record. A non-functional requirement describes a characteristic of the system or process, such as a performance requirement.

Anna
Before serious development begins, the team can build a prototype. A prototype does not have to be functional; it could even consist of PowerPoint slides. Its purpose is to show the customer what the interface might look like, how parts of the program connect, and how the system may work.

Simon
The prototype leads to feedback and repeated adjustments. The team and customer go back and forth until the users’ needs are being met and the requirements are sufficiently clear. Only then is it sensible to move into serious development.

Anna
The second broad stage is planning. Planning often happens at the same time as requirements gathering and analysis, but its focus is the coming weeks and months: what needs to be built, in what order, and how the different parts will interact.

Simon
This becomes especially important in a large project with tens of thousands of lines of code. A roadmap helps the team understand the architecture and approach the work systematically. A major part of planning is modularization: breaking a large program into smaller, organized components.

Anna
When modularizing, two major goals are high cohesion and low coupling. Cohesion describes how closely related the elements inside one module are. A records module with functions that retrieve and manipulate records has high cohesion because everything supports one clear responsibility.

Simon
A general utilities module can have low cohesion if it simply collects unrelated functions that had nowhere else to go. Coupling is different: it describes how dependent modules are on one another. If changing one module forces many changes elsewhere, the modules are highly coupled.

Anna
Low coupling is preferable. Ideally, modules communicate by passing messages and do not depend on each other’s internal workings. In a game, for example, the game engine can request the player’s position from a player module, request an enemy’s position from an enemy module, compare the positions, and then send a message telling the player module to reduce health if a collision occurs.

Simon
Because those modules communicate through defined messages, the design can be extended to multiple players or different enemy types without changing the basic interaction. High coupling would be more like having every module share and directly manipulate one common game-state variable. That creates dependencies everywhere, so a change in one place can confuse or break many other parts.

Anna
High cohesion and low coupling create separation of concerns. Each module handles its own responsibility and does not need to know how other modules work. That improves readability and maintainability because a fix or upgrade can usually be made in one focused location without unexpectedly breaking other parts.

Simon
After the requirements and planning work, development can begin. One structured technique used during development is a design pattern. When a common type of problem appears repeatedly, a pattern offers a standardized, tried-and-tested approach. Patterns make code more intuitive and increase confidence in its correctness compared with inventing a completely different solution each time.

Anna
A major example is Model-View-Controller, or MVC. The model contains the data and logic in an abstract form. The view takes information from the model and presents it to the user. The controller handles the user’s interactions, such as pressing buttons, and allows the user to change what they see or modify data in the model.

Simon
In the sales example, the model could contain sales records, the view could display those records in a table, and the controller could be the buttons in a sidebar. MVC provides substitutability: the table could be replaced by a chart without changing the model or controller. Likewise, an administrator’s controller could provide additional tools while leaving the model and view unaffected.

Anna
Professional development also emphasizes readable code because large projects are maintained and modified over time, often by teams. One good practice is avoiding magic numbers—unclear numerical values embedded directly in code. A strange numerical code from an infrared remote might make sense today, but months later it would be difficult to remember what that number represents.

Simon
The solution is to assign the value to a meaningful variable or, in C++, possibly a macro. A name such as previousButton communicates its purpose far better than an unexplained number. Clear naming matters in general: function names should often be verbs, such as queryDatabase, while Boolean variables should express a state, such as isOn. Then an expression like if isOn reads almost like ordinary English.

Anna
Another important tool is a revision control system, such as the systems used through GitHub. Revision control tracks changes so developers can move between versions of the code. It also supports collaboration because multiple programmers can commit their work and merge their contributions into the final product.

Simon
Testing is another major difference between hobbyist and professional development. Randomly clicking around and deciding that everything seems fine is not enough for a large project. Automated testing runs specified test cases against the code, often function by function, and compares the actual results with expected results.

Anna
The most common automated approach is unit testing. A unit test supplies an input to a module or function, states the expected result, runs the code, and compares the result with that expectation. If a test fails, it not only tells us that something is wrong; it helps identify the operation that violated the expectation—for example, a function adding two numbers when it should have subtracted them.

Simon
Integration testing goes a step further by testing multiple modules working together. Individual modules might each work correctly while their connection is broken. In the sales system, we could edit a record through the controller and then check whether the model changed correctly. That tests the link between those components.

Anna
Testing can also be black box or white box, sometimes called glass box testing. Black box testing ignores the internal implementation: we provide inputs according to the specification and check the outputs. White box testing takes the internal implementation into account, choosing inputs that exercise particular internal paths or testing internal features directly.

Simon
Both approaches have value, and ideally a system is tested in both ways. There are other testing areas too. GUI testing checks that visible elements respond correctly to user actions, potentially using screen capture, screen-reading tools, or automated keystrokes. Security testing may send randomized inputs to something like a login box, helping reveal flaws that carefully chosen normal inputs might miss.

Anna
Code coverage measures how much of the program is actually exercised by tests. Achieving complete coverage is difficult because code contains functions, branches, loops, and different possible program states. A loop may need to be tested when it runs once, twice, or several times, and a stateful program may behave differently in many possible states. Even so, greater coverage is generally better.

Simon
Test-driven development, or TDD, makes testing central to the development process. The developer writes a test before writing the corresponding code, observes the test fail, and then writes only enough code to make it pass. The cycle continues with another test, gradually building the program while aiming for strong test coverage.

Anna
So the process we have described has four broad phases: requirements, planning, development, and testing. But they should not be treated as completely separate steps. They can overlap or happen concurrently, depending on the project.

Simon
And the process does not necessarily end when the product is deployed. After using the software, a customer may request improvements, enhancements, or bug fixes. The team then gathers new requirements, plans the changes, prototypes where useful, develops them, and tests again.

Anna
That repeated cycle is why software engineering is so important for large-scale projects. It provides a disciplined way to build the correct product, maintain readable and organized code, collaborate with a team, and gain confidence that the system behaves correctly, efficiently, and securely.

Simon
Coding is certainly part of professional development, but software engineering is the broader skill that makes coding sustainable in the real world. It helps teams create software that can be understood, tested, changed, and improved over time. This episode is only an introduction, but those foundations explain why software engineering is such an important area of study.

Ask anything
We've read this whole study set, so questions about it get the best answers.