Introduction to software engineering
Course Code: SE104
Target Group: Software Engineering
Instructor: Biniam Behailu
July, 2024
Chapter 5 Outline
Implementation/Build/Coding
01 Implementation language and platform
issues
02 Pair Programming
03 Refactoring
04 Design Patterns
05 Test driven development (TDD)
Implementation/Coding/Build
Refers to the stage where software developers and stakeholders
actually put their plans into action and develop the software system.
The development team translates the design document into actual
code.
This process involves writing and configuring software modules
integrating them, and creating a working software system.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 3
Implementation/Coding/Build
Developers utilize programming languages, frameworks, and tools to
ensure that the software functions as intended.
Requires strong programming skills, attention to detail, and
adherence to coding standards and best practices.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 4
Implementation language and platform issues
A programming language is a set of rules that provides a way of telling
a computer what operations to perform.
A programming language is a set of rules for communicating an
algorithm
It provides a linguistic framework for describing computations
For implementing the design into a code, we require a good high level
language (like Java, Python, JavaScript, Ruby, Php)
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 5
Implementation language and platform issues
The issues are critical considerations during the software
implementation.
Choosing the right programming language and platform can
significantly impact the performance, scalability, maintainability, and
overall success of the software project.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 6
Implementation language and platform issues
Language issues:
Compatibility: Ensuring the chosen language is compatible with other system
components.
Learning Curve: If the team is not familiar with the chosen language, it may slow
down development.
Maintenance: Some languages may lead to more complex and harder-to-
maintain code.
Tooling Support: The availability of development tools, debuggers, and integrated
development environments (IDEs) for the language.
Community: A larger community typically indicates greater popularity, more
available resources, and a higher likelihood of finding answers to common
problems.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 7
Implementation language and platform issues
Cross-Platform Compatibility: Ensuring the software works across different
operating systems and devices.
Deployment: Challenges in deploying applications across various
environments.
Performance: Different platforms may have different performance
bottlenecks.
Vendor Lock-In: Risks associated with relying heavily on a single vendor’s
platform and technologies.
Licensing and Costs: Platform licensing fees and associated costs can impact
the project budget.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 8
Pair programming
Is an agile software development technique where two programmers work
together at one workstation.
o One, the "driver," writes code while the other,
o the "observer" or "navigator," reviews each line of code as it is typed in.
o The two programmers switch roles frequently.
This collaborative approach has several benefits that can enhance the
quality and efficiency of software development projects.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 9
Pair programming
Advantages Challenges
Improved Code Quality Increased Cost
Knowledge Sharing Personality Conflicts
Enhanced Collaboration Coordination and Synchronization
Faster Problem Solving Skill Disparities
Increased Focus Scheduling and availability
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 10
Pair programming(Tools)
Screen Sharing Tools
o Zoom, Microsoft Teams, or Google Meet for remote pair programming.
Collaborative Development Environments
o JetBrains IDEs (IntelliJ IDEA, PyCharm, etc.) with Code With Me plugin
o Visual Studio with Live Share extension
o Eclipse with Saros plugin
Version Control Systems
o Git to manage changes and collaborate effectively
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 11
Pair programming(Tools)
Application Sharing and Remote Desktop Tools
o TeamViewer
o AnyDesk
o Microsoft Remote Desktop
Messaging and Collaboration Platforms
o Slack
o Microsoft Teams
o Discord
o Miro
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 12
Refactoring
The process of restructuring existing computer code without changing its
external behavior (feature of the software).
The main goal is to improve the nonfunctional attributes of the software,
making it easier to understand, maintain, and extend.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 13
Refactoring
Objectives of Refactoring
Identify Code Smells: Look for signs in the code that indicate potential problems,
such as large methods, duplicated code, complex conditional logic, or overly
coupled classes. These "code smells" can be a good starting point for refactoring.
Improve Code Readability: Making the code easier to read and understand.
Enhance Maintainability: Simplifying the process of maintaining and updating
the code.
Reduce Complexity: Breaking down complex code into simpler, more manageable
pieces.
Remove Redundancy: Eliminating duplicate code and consolidating similar
functions.
Optimize Performance: Improving the efficiency of the code without altering its
behavior.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 14
Refactoring
Can be achieved with different techniques
Rename Variables and Methods: Using descriptive names for variables and
methods to improve readability.
Simplify Conditional Expressions: Refactoring complex conditional
expressions to make them clearer and more concise.
Many IDEs support refactoring with extensions and built-in features.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 15
Refactoring
Best practices
Refactor in Small Steps, Test Frequently
Use Version Control: Keep track of changes and be able to revert to
previous versions if necessary.
Maintain Readability
Document Changes
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 16
Design patterns
Design patterns are reusable solutions to common software design
problems.
They provide a way to structure and organize code in a way that promotes
modularity, flexibility, and maintainability.
They are general templates or best practices that guide developers in
creating well-structured, maintainable, and efficient code.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 17
Design patterns (Benefits)
Improved Code Reuse: Design patterns capture best practices and proven
solutions to recurring problems, allowing developers to reuse code and avoid
reinventing the wheel.
Enhanced Flexibility and Extensibility: Many design patterns, such as the
Strategy, Observer, and Decorator patterns, make it easier to modify the behavior
of a system without extensive changes to the codebase.
Clearer Communication: Design patterns provide a common vocabulary for
describing and discussing software architecture, making it easier for developers
to collaborate and understand each other's code.
Reduced Complexity: By providing well-established solutions to common
problems, design patterns can help manage the complexity of large, enterprise-
level software systems.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 18
Design patterns (Benefits)
Creational Patterns: Such as Singleton, Factory Method, and Abstract
Factory, which deal with the creation of objects.
Structural Patterns: Such as Adapter, Decorator, and Composite, which
focus on the composition of objects.
Behavioral Patterns: Such as Observer, Strategy, and Command, which
describe how objects interact and distribute responsibilities.
Architectural Patterns: Such as Model-View-Controller (MVC), Layered
Architecture, and Microservices, which provide high-level structures for
designing entire applications.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 19
Test driven development (TDD)
A software development methodology in which tests are written before the
code that needs to be tested.
The process emphasizes creating small, incremental improvements to the
code, guided by automated tests to ensure functionality and correctness.
It ensures that code is always tested and functional, reducing bugs and
improving code quality.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 20
Test driven development (TDD)
The process follows a specific cycle:
Write a Test: The developer starts by writing a test case that defines the desired
behavior of the code being developed.
Run the Test: The developer runs the test, which should initially fail since the
code to make the test pass has not yet been written.
Write the Code: The developer then writes the minimum amount of code
necessary to make the test pass.
Refactor: Once the test passes, the developer refactors the code to improve its
design, maintainability, and efficiency, while ensuring the test still passes.
Repeat: The developer then repeats this cycle, writing a new test, making it pass,
and refactoring the code as necessary.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 21
Test driven development (TDD)
The benefits of TDD include:
Improved Code Quality: The focus on writing tests first helps to identify and
address design and implementation issues early in the development process.
Reduced Debugging Time: Automated tests make it easier to identify and fix
bugs, as the tests can quickly pinpoint the source of the problem.
Better Design: The refactoring step encourages developers to continuously
improve the design of the code, leading to more modular and maintainable
systems.
Faster Development Cycles: TDD's emphasis on small, incremental changes can
lead to faster development cycles and more efficient use of developer time.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 22
Coding Guidelines
A set of standards and best practices that developers follow to ensure their code
is consistent, readable, maintainable, and free from common errors.
Adhering to coding guidelines helps improve the quality and reliability of the
software.
Best Practices
DRY Principle: Don’t Repeat Yourself. Reuse code wherever possible to avoid
duplication.
KISS Principle: Keep It Simple, Stupid. Write simple and straightforward code.
YAGNI Principle: You Ain’t Gonna Need It. Avoid adding functionality until it is
necessary
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 23
Coding Guidelines
Key areas
Naming conventions: proper name for functions, class, variables, constants and
global variables.
Code formatting:
o Indentation: Use consistent indentation, typically 2 or 4 spaces.
o Line Length: Keep lines of code within a reasonable length (e.g., 80-100
characters).
o Braces and Parentheses: Follow consistent conventions for the placement of
braces and parentheses.
o Spacing: Use spaces around operators and after commas to improve
readability.
Commenting: describe the purpose and usage, use inline comments
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 24
Coding Guidelines
Code Structure
o Functions and Methods: Keep functions and methods short and focused on a single
task.
o Classes: Organize related functions and data into classes, adhering to the principles of
object-oriented design.
o Modules: Group related classes and functions into modules for better organization and
reusability.
Error Handling
o Exceptions: Use exceptions for error handling and ensure they provide meaningful
error messages.
o Logging: Implement logging to capture error conditions and significant events.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 25
THANK YOU
?
"Coding is the brush that paints the
digital canvas, where logic and
creativity converge to craft innovative
experiences."
Compiled by : Biniam Behailu Introduction to Software Engineering 26