0% found this document useful (0 votes)
16 views

UNIT 4se Removed

Uploaded by

patromohan125
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

UNIT 4se Removed

Uploaded by

patromohan125
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

UNIT 4

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.

• The purpose of coding is to create a set of instructions in a programming language so that


computers execute them to perform certain operations.

• Implementation is the software development phase that affects the testing


and maintenance activities.

• 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.

• Developed software goes through testing, maintenance, and reengineering. .

• 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.

• Information hiding is supported by data abstraction, which allows creating


multiple instances of abstract data type.

1
• Most of object-oriented programming languages such as C++, Java etc., support the
features of information hiding.

• Structured programming languages, such as C, Pascal, FORTRAN, etc., provide


information hiding in a disciplined manner.

Structure Programming Features



 the program flow in some sequential way that the
Structured programming features linearize
 programs follow during their execution.


 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.

 – Selection: It provides branching of statements using if-then-else, switch-case, etc.

– Iteration: A statement can be executed repeatedly using while-do, repeat-until,


while, etc.

Maximize Cohesion and Minimize Coupling

– 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.

– Minimizing dependencies among programs will maximize cohesion within modules;


that is, there will be more use of local data rather than global data items.

– High cohesion and low coupling make a program clear, readable, and maintainable.

• Code Reusability allows the use of existing code several times.

• KIS (Keep It Simple)

– Most of the software are structurally complex but can be made simple by using
modularization and other designing principles.

• Simplicity, Extensibility, and Effortlessness

• Code Verification

• Code Documentation

• Separation of Concern

• Follow Coding Standards, Guidelines, and Styles

Coding Process:
• The coding process describes the steps that programmers follow for producing source codes.

• The coding process allows programmers to write bug-free source codes.

• It involves mainly coding and testing phases to generate a reliable code.

• The coding process describes the steps that programmers follow for producing source codes.

• The coding process allows programmers to write bug-free source codes.

• Two widely used coding processes.

• Traditional Coding Process

• Test-driven Development (TDD)

Traditional Coding Process

• The traditional programming process is an iterative and incremental process which


follows the “write-compile-debug” process.

• TDD was introduced by Extreme Programming (XP) in agile methodologies that follow the
“coding with testing” process

3
• Test-Driven Development

– Developed software goes through a repeated maintenance process due to lack of


quality and inability to satisfy the customer needs.

– System functionality is decomposed into several small features.

– Test cases are designed before coding.

– Unit tests are written first for the feature specification and then the small source
code is written according to the specification.

– Source code is run against the test case.

– 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.

– The errors found during code verification are debugged.

• Following methods are used for code review:

– 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

 It aims at detecting programming defects in the source code.


 The code inspection team consists of a programmer, a designer, and a tester.
 The inspectors are provided the code and a document of checklists.

 In the inspection process, definite roles are assigned to the team members, who inspect the
code in a more rigorous manner. Also, the checklists help them to catch errors in a smooth
 manner.
 Code inspection takes less time as compared to code walkthrough.
 Most of the software companies prefer software inspection process for code review.

Pair programming

 It is an extreme programming practice in which two programmers work together at one


workstation, i.e., one monitor and one keyboard. In the current practice, programmers can
use two keyboards.

 During pair programming, code review is done by the programmers who write the code. It is
 possible that they are unable to see their own mistakes.
 With the help of pair programming, the pair works with better concentration.

 They catch simple mistakes such as ambiguous variable and method names easily. The
pair shares knowledge and provides quick solution.

 Pair programming improves the quality of software and promotes knowledge sharing between
the team members.

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 This is performed with program analysis tools.

o Static analysis tools help to identify redundancies in source codes.

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

o Dynamic analysis works with test data by executing test cases.

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.

• Documents act as a communication medium between the different team members


of development.

• They help users in understanding the system operations.

• Documents prepared during development are problem statement, software requirement


specification (SRS) document, design document, documentation in the source codes, and
test document.

• These documents are used by the development and maintenance team members.

• There are following categories of documentation done in the system

• 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.

• Coding standards play the role of maintaining commonality in coding styles


among programmers.

• 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.

• Documentation help users in understanding the system operations. Documents prepared


during development are problem statement, software requirement specification (SRS)
document, design document, documentation in the source codes, and test document.

You might also like