Unit 3 18Csc206J - Software Engineering and Project Management
Unit 3 18Csc206J - Software Engineering and Project Management
Disclaimer:
The lecture notes have been prepared by referring to many books and notes prepared by the teachers. This document does not claim
any originality and cannot be used as a substitute for prescribed textbooks.
Course Learning Rationale (CLR)
3
CLO-3
:Design CL0-3 :
Design
the the
system system
Course based on
Learning Function based on
Object
Outcome al Oriented
s (CLO): Oriented
Approach
Approach for
for Software
Software
Design.
Design.
4
Topics
• Software Construction
• Coding Standards
• Coding Framework
• Reviews – Desk Checks (Peer Reviews)
• Walkthroughs
• Code Reviews, Inspections
• Coding Methods
• Structured Programming
• Object-Oriented Programming
• Automatic Code Generation
• Software Code Reuse
• Pair Programming
• Test-Driven Development
• Configuration Management
• Software Construction Artefacts
5
Software Construction
Introduction
Introduction (continued)
• What a user sees as the product at the end of the software development life
cycle is merely the result of the software code that was written during software
construction.
• Due to the labor intensive nature of the software construction phase, the work
is divided not only among developers, but also small teams are formed to work
on parts of the software build.
• In fact, to shrink the construction time, many distributed teams, either internal
or through contractors are deployed.
• The advantage to this is that these project teams do the software coding and
other construction work in parallel with each other and thus the construction
phase can be collapsed.
Software Construction
Introduction (continued)
Introduction
• Developers are given software design specifications in the form of use cases,
flow diagrams, UI mock ups, etc., and they are supposed to write a code so that
the built software matches these specifications.
• How well they do it depends on their experience, skills and the process they
follow to do their job.
• Apart from these facilities, they also need some standards in their coding so that
the work is fast as well as has other benefits like maintainability, readability and
reusability (Figure in next slide).
Coding Standards
• At any time, a code written by a developer will always be different from that
written by any other developer.
• This poses a challenge in terms of comprehending the code while reusing the
code, maintaining it, or simply reviewing it.
• A uniform coding standard across all construction teams working on the same
project will make sure that these issues can be minimized if not eliminated
(Figure below - Software Construction Characteristics).
• Some of the coding standards include standards for code modularity, clarity,
simplicity, reliability, safety and maintainability.
Coding Standards
1) Modularity
2).Clarity
• The produced code should be clear for any person who would read the source
code.
• Standard naming conventions should be used so that the code has ample clarity.
• There should be sufficient documentation inside the code block, so that
anybody reading the code could understand what a piece of code is supposed to
do.
• There should also be ample white spaces in the code blocks, so that no piece of
code should look crammed. White spaces enhance readability of written code.
Coding Standards
Software Construction characteristics (continued)
3) Reliability
• Reliability is one of the most important aspects of industry strength software
products.
• Reliability of source code can be increased by sticking to the standard processes
for software construction.
• During reviews, if any defects are found, they can be fixed easily if the source
code is neat, simple, and clear.
• Reliable source code can be achieved by first designing the software product
with future enhancement in consideration as well as by having a solid structure
on which the software product is to be built.
• When writing pieces of source code based on this structure, there will be little
chance of defects entering into the source code.
• Generally during enhancements, the existing structure is not able to take load of
additional source code and thus the structure becomes shaky.
• If the development team feels that this is the case, then it is far better to
restructure the software design and then write a code based on the new
structure than to add code.
Coding Standards
4) Safety
5) Simplicity
• The source code should have simplicity and no unnecessary complex logic;
improvisation should be involved, if the same functionality can be achieved by a
simpler piece of source code.
• Simplicity makes the code readable and will help in removing any defects found
in the source code.
• Simplicity of written code can be enhanced by adopting best practices for many
programming paradigms.
• Similarly, breaking the product to be developed into meaningful pieces that
mimic real life parts makes the software product simple.
Coding Standards
6) Maintainability
• As it has been pointed out after several studies, maintenance costs are more
than 70% of all costs including software development, implementation, and
maintenance.
• To make sure that maintenance costs are under limit during software
construction, it should be made sure that the source code is maintainable.
• It will be easy to change the source code for fixing defects during maintenance.
Coding Framework
• It is estimated that almost 70% of software defects arise from faulty software
code.
• To compound this problem, software construction is the most labor intensive
phase in software development.
• Any construction rework means wasting a lot of effort already put in.
• Moreover, it is also a fact that it is cheaper to fix any defects found during
construction at the phase level itself.
• If those defects are allowed to go in software testing (which is the next phase),
then fixing those defects will become costlier.
Software Code Review
• These different kinds of reviews are done at different stages in software code
writing.
• They also serve different purposes.
• While inspections provide the final go/no go decision for approval of a piece of
code, other methods are less formal and are meant for removing defects instead
of deciding whether a piece of code is good enough or not.
Software Code Review
• Deskchecks are employed when a complete review of the source code is not
important.
• Here, the developer sends his piece of code to the designated team members.
• These team members review the code and send feedback and comments to the
developer as suggestions for improvement in the code.
• The developer reads those feedbacks and may decide to incorporate or to
discard those suggestions.
• So this form of review is totally voluntary.
• Still, it is a powerful tool to eliminate defects or improve software code.
Software Code Review
Reviews – Walkthroughs
• Walkthroughs are formal code reviews initiated by the developer. The developer
sends an invitation for walkthrough to team members.
• At the meeting, the developer presents his method of coding and walks through
his piece of code.
• The team members then make suggestions for improvement, if any.
• The developer then can decide to incorporate those suggestions or discard
them.
Software Code Review
• Code reviews are one of the most formal methods of reviews. The project
manager calls for a meeting for code review of a developer.
• At the meeting, team members review the code and point out any code errors,
defects, or improper code logic for likely defects. An error log is also generated
and is reviewed by the entire team.
Reviews – Inspections
Introduction
• Converting design into optimal software construction is a very serious topic that
has generated tremendous interest over the years.
• Many programming and coding methods were devised and evolved as a result.
• As it is well known in the industry, the early software products were of small size
due to limited hardware capacity.
• With increasing hardware capacity, the size of software products has been
increasing.
• Software product size affects the methods that can be used to construct specific
sized software products.
Coding Methods
Introduction (continued)
Structured Programming
Object-Oriented Programming
• Many techniques have evolved to reduce the labor intensive nature of writing
source code.
• Software code reuse is one such technique.
• Making a block of source code to create a functionality or general utility library
and using it at all places in the source code wherever this kind of functionality or
utility is required is an example of code reuse.
• Code reuse in procedural programming techniques is achieved by creating
special functions and utility libraries then using them in the source code.
• In object-oriented programming, code reuse is done at a more advanced level.
Coding Methods
Pair Programming
Test-Driven Development
Introduction
• The software construction phase is one of the most labor intensive phases in
software development cycle.
• This phase generates the complete source code of the application.
• Apart from source code, documentation is also made so that when any
maintenance is required on the built application, the source code could be well
understood, and changing any source code will be easy.
• Review reports are also generated after reviews are conducted.
REFERENCE
• Ashfaque Ahmed, Software Project Management: A Process-driven approach,
Boca Raton, Fla: CRC Press, 2012.