UNIT 4se Removed
UNIT 4se Removed
Implementation
• The software engineer translates the design specifications into source codes in
some programming language.
• The main goal of implementation is to produce quality source codes that can reduce the
cost of testing and maintenance.
• A clear, readable, and understandable source code will make testing, debugging, and
maintenance tasks easier.
• Source codes are written for functional requirements but they also cover some
nonfunctional requirements.
• Unstructured and structured programming produce more complex and tedious codes than
object-oriented, fourth generation languages, component based programming etc.
• A well- documented code helps programmers in understanding the source codes for
testing and maintenance.
• Software engineers are instructed to follow the coding process, principles, standards, and
guidelines for writing source codes.
• Finally, the code is tested to uncover errors and to ensure that the product satisfies the
needs of the customer.
Coding Principles
• Coding principles are closely related to the principles of design and modeling.
• Coding principles help programmers in writing an efficient and effective code, which is easier
to test, maintain, and reengineer.
Information Hiding
• Data encapsulation binds data structures and their operations into a single module.
• The operations declared in a module can access its data structures and allow
other modules to access them via interfaces.
• Other modules can access data structures through access specifiers and interfaces
available in modern programming languages.
1
• Most of object-oriented programming languages such as C++, Java etc., support the
features of information hiding.
flow is achieved through the following three basic constructs of
The organization of program
structured programming.
– Sequence: It provides sequential ordering of statements, i.e., S1, S2, S3, … Sn.
– Writing modular programs with the help of functions, code, block, classes, etc., may
increase dependency among modules in the software.
– The main reason is the use of shared and global data items.
2
– Shared data should be used as little as possible.
– High cohesion and low coupling make a program clear, readable, and maintainable.
– Most of the software are structurally complex but can be made simple by using
modularization and other designing principles.
• Code Verification
• Code Documentation
• Separation of Concern
Coding Process:
• The coding process describes the steps that programmers follow for producing source codes.
• The coding process describes the steps that programmers follow for producing source codes.
• TDD was introduced by Extreme Programming (XP) in agile methodologies that follow the
“coding with testing” process
3
• Test-Driven Development
– Unit tests are written first for the feature specification and then the small source
code is written according to the specification.
– It is quite possible that the small code written may not meet the requirements, thus
it will fail the test.
– After failure, we need to modify the small code written before to meet the
requirements and run it again.
– If the code passes the test case implies the code is correct. The same process is
repeated for another set of requirements specification.
4
Code Verification
• Code verification is the process of identifying errors, failures, and faults in source codes,
which cause the system to fail in performing specified tasks.
• Code verification ensures that functional specifications are implemented correctly using
a programming language.
• There are several techniques in software engineering which are used for code verification.
– Code review
– Static analysis
– Testing
• Code review
– It is a traditional method for verification used in the software life cycle. It mainly
aims at discovering and fixing mistakes in source codes.
– Code review is done after a successful compilation of source codes. Experts review
codes by using their expertise in coding.
– Code walkthrough
– Code inspection
– Pair programming
Code walkthrough
A code walkthrough is a technical and peer review process of finding mistakes in source codes.
The walkthrough team consists of a review and a team of reviewers.
5
The reviewers examine the code either using a set of test cases or by changing the source code.
During the walkthrough meeting, the reviewers discuss their findings to correct mistakes
or improve the code.
The reviewers may also suggest alternate methods for code improvement.
The walkthrough session is beneficial for code verification, especially when the code is
not properly documented.
Sometimes, this technique becomes time consuming and tedious. Therefore, the walkthrough
session is kept short.
Code inspection
Pair programming
Static analysis
o Source codes are not executed rather these are given as input to some tool that
provides program behavior.
o Static analysis is the process of automatically checking computer programs.
o They identify idempotent operations, data declared but not used, dead codes, missing
data, connections that lead to unreachable code segments, and redundant assignments.
o They also identify the errors in interfacing between programs. They identify mismatch
errors in parameters used by the team and assure compliance to coding standards.
Testing
6
o Testing is performed before the integration of programs for system testing.
o Also, it is intended to ensure that the software ensures the satisfaction of customer
needs.
Code Documentation:
• Software development, operation, and maintenance processes include various kinds
of documents.
• These documents are used by the development and maintenance team members.
• Internal documentation
• System documentation
• User documentation
• Process documentation
• Daily documentation
• Implementation is the coding phase in which software engineers translate the design
specifications into source codes in a programming language.
• Coding principles help programmers in writing an efficient and effective code, which is easier
to test, maintain, and reengineer.
• Code verification is the process of identifying errors, failures, and faults in source codes,
which cause the system to fail in performing the specified tasks.
• The traditional coding process and test-driven development (TDD) are two widely
used coding processes.