Implementation
Implementation
A Mukuze
Implementation
• Implementing can be defined as putting (a decision, plan, agreement,
etc.) into effect.
• •Systems implementation is the delivery of that system into
production (that is, the day-to-day business or organization operation
• •It is important you understand that Implementation isn't about
BUILDING or PROGRAMMING a system, but rather making the system
live
Main Areas to be covered
• Implementation
• Coding
• Unit testing and debugging
• Conversion methods
Coding
• The coding is the process of transforming the design of a system into
a computer language format. This coding phase of software
development is concerned with software translating design
specification into the source code. It is necessary to write source code
& internal documentation so that conformance of the code to its
specification can be easily verified.
• Coding is done by the coder or programmers who are independent
people than the designer. The goal is not to reduce the effort and cost
of the coding phase, but to cut to the cost of a later stage. The cost of
testing and maintenance can be significantly reduced with efficient
coding.
Goals of Coding
• To translate the design of system into a computer language format: The coding is
the process of transforming the design of a system into a computer language
format, which can be executed by a computer and that perform tasks as specified
by the design of operation during the design phase.
• To reduce the cost of later phases: The cost of testing and maintenance can be
significantly reduced with efficient coding.
• Making the program more readable: Program should be easy to read and
understand. It increases code understanding having readability and
understandability as a clear objective of the coding activity can itself help in
producing more maintainable software.
• For implementing our design into code, we require a high-level functional
language. A programming language should have the following
characteristics:
Characteristics of Programming
Language
Characteristics of Programming Language
• Readability: A good high-level language will allow programs to be written in some methods that resemble a quite-
English description of the underlying functions. The coding may be done in an essentially self-documenting way.
• Portability: High-level languages, being virtually machine-independent, should be easy to develop portable software.
• Generality: Most high-level languages allow the writing of a vast collection of programs, thus relieving the
programmer of the need to develop into an expert in many diverse languages.
• Brevity: Language should have the ability to implement the algorithm with less amount of code. Programs mean in
high-level languages are often significantly shorter than their low-level equivalents.
• Error checking: A programmer is likely to make many errors in the development of a computer program. Many high-
level languages invoke a lot of bugs checking both at compile-time and run-time.
• Cost: The ultimate cost of a programming language is a task of many of its characteristics.
• Quick translation: It should permit quick translation.
• Efficiency: It should authorize the creation of an efficient object code.
• Modularity: It is desirable that programs can be developed in the language as several separately compiled modules,
with the appropriate structure for ensuring self-consistency among these modules.
• Widely available: Language should be widely available, and it should be feasible to provide translators for all the
major machines and all the primary operating systems.
• A coding standard lists several rules to be followed during coding, such as the way variables are to be named, the
way the code is to be laid out, error return conventions, etc.
Coding Standards
• Programming style refers to the technique used in writing the source code
for a computer program. Most programming styles are designed to help
programmers quickly read and understands the program as well as avoid
making errors. (Older programming styles also focused on conserving
screen space.) A good coding style can overcome the many deficiencies of a
first programming language, while poor style can defeat the intent of an
excellent language.
• The goal of good programming style is to provide understandable,
straightforward, elegant code. The programming style used in a various
program may be derived from the coding standards or code conventions of
a company or other computing organization, as well as the preferences of
the actual programmer.
Some general rules or guidelines in respect of
programming style:
Some general rules or
guidelines in respect of
programming style:
• Clarity and simplicity of Expression: The programs should be designed in such a manner so that the objectives of the
program is clear.
• Naming: In a program, you are required to name the module, processes, and variable, and so on. Care should be taken
that the naming style should not be cryptic and non-representative.
• For Example: a = 3.14 * r * r
area of circle = 3.14 * radius * radius;
• 3. Control Constructs: It is desirable that as much as a possible single entry and single exit constructs used.
• 4. Information hiding: The information secure in the data structures should be hidden from the rest of the system where
possible. Information hiding can decrease the coupling between modules and make the system more maintainable.
• 5. Nesting: Deep nesting of loops and conditions greatly harm the static and dynamic behavior of a program. It also
becomes difficult to understand the program logic, so it is desirable to avoid deep nesting.
• 6. User-defined types: Make heavy use of user-defined data types like enum, class, structure, and union. These data
types make your program code easy to write and easy to understand.
• 7. Module size: The module size should be uniform. The size of the module should not be too big or too small. If the
module size is too large, it is not generally functionally cohesive. If the module size is too small, it leads to unnecessary
overheads.
• 8. Module Interface: A module with a complex interface should be carefully examined.
• 9. Side-effects: When a module is invoked, it sometimes has a side effect of modifying the program state. Such side-
effect should be avoided where as possible.
Structured Programming
• Structured Programming
• In structured programming, we sub-divide the whole program into
small modules so that the program becomes easy to understand. The
purpose of structured programming is to linearize control flow
through a computer program so that the execution sequence follows
the sequence in which the code is written. The dynamic structure of
the program than resemble the static structure of the program. This
enhances the readability, testability, and modifiability of the program.
This linear flow of control can be managed by restricting the set of
allowed applications construct to a single entry, single exit formats.
Why we use Structured
Programming?
• We use structured programming because it allows the programmer to
understand the program easily. If a program consists of thousands of
instructions and an error occurs then it is complicated to find that error in
the whole program, but in structured programming, we can easily detect
the error and then go to that location and correct it. This saves a lot of
time.
• These are the following rules in structured programming:
• Structured Rule One: Code Block
• If the entry conditions are correct, but the exit conditions are wrong, the error must
be in the block. This is not true if the execution is allowed to jump into a block. The
error might be anywhere in the program. Debugging under these circumstances is
much harder.
Rule 1 of Structured
Programming
• Rule 1 of Structured Programming: A code block is structured, as
shown in the figure. In flow-charting condition, a box with a single
entry point and single exit point are structured. Structured
programming is a method of making it evident that the program is
correct.
Structure Rule Two: Sequence
Implementation
Software Engineering I
What is STLC?
• Software Testing Life Cycle [STLC] is the order of different activities
executed throughout the software testing process. Testing itself has
many phases called STLC, and each activity is done to improve the
quality of the software product.
S.NO Comparison basis SDLC STLC
1. Explanations It is primarily connected to software development, which means It is mainly linked to software testing, which means
that it is the procedure of developing a software application. that it is a software testing process that contains
various phases of the testing process.
2. Representation SDLC stands for Software Development Life Cycle. STLC stands for Software Testing Life cycle.
3. Resources While performing the SDLC process, we needed a greater number of The STLC process needed a smaller number of
developers to complete the development process. testers to complete the testing process.
4. Focuses on Besides the development phase, other phases like testing are also The STLC concentrate only on testing the software.
included.
5. Objective The objective of the Software development life cycle is to The objective of the Software testing life
complete the development of software successfully. cycle is to complete the testing of software
successfully.
6. Help in The SDLC will help us to develop a good quality software product. The STLC will helps to create the software bug-free.
7. Different phases •The various phase includes in Software Development Life •The various phase includes in Software Testing
Cycle are as follows:Requirements Collection Life Cycle are as follows:Requirement collection or
•Feasibility Study System study
•Design •Test Plan
•Programming or Coding •Write test case
•Testing •Traceability Matrix
•Installation •Defect Tracking
•Maintenance •Test Execution Report
•Retrospect meeting
8. Requirement In the SDLC Requirement collection phase, the BA [Business In the Requirement Analysis phase of the STLC, the
collection phase Analyst] and PA [ Product Analyst] will collect the requirements QA [ Quality Assurance]
and interpret business language into software language. team will study requirement documents and
prepare the System Test Plan.
9. Designing phase Based on the requirement understanding, the development team Generally, in STLC, the Test Architect or a Test
will develop the HLD [High-Level Design] and LLD [Low-Level Lead plan the test strategy.
Design] of the software. And also finds the testing points.
10. Coding phase In the SDLC coding phase, the developer will start writing the code In STLC, the QA team writes the test scenarios to
as per the designed document and beginning of building the authenticate the quality of the product.
software.
11. Environment Set up After writing the code, the development team sets up a test Based on the prerequisites, the Test team confirms
environment with the developed product to validate the code. the environment set up. And do one round of
smoke testing to ensure that the environment is
stable for the product and ready for testing.
Testing
• The SDLC and STLC provide a structure to
the development and testing of software.
• Generally, the test engineer may feel that the Software development
life cycle is appropriate to developers only. Still, after understood the
complete process of the development and testing life cycle, we can
say that both life cycles are dependent and time to time performed in
parallel.
• Hence, it is beneficial even to test engineers if they understand
the SDLC phase with STLC.
Testing Strategies
• Software is tested to uncover errors introduced during design and construction. Testing
often accounts for More project effort than other s/e activity. Hence it has to be done
carefully using a testing strategy.
• The strategy is developed by the project manager, software engineers and testing
specialists. Testing is the process of execution of a program with the intention of finding
errors Involves 40% of total project cost
• Testing Strategy provides a road map that describes the steps to be conducted as part of
testing.
• It should incorporate test planning, test case design, test execution and resultant data
collection and execution
• Validation refers to a different set of activities that ensures that the software is traceable
to the Customer requirements.
• V&V encompasses a wide array of Software Quality Assurance
A strategic Approach for Software
testing
• Testing is a set of activities that can be planned in advance and conducted
systematically. Testing strategy Should have the following characteristics:
• -- usage of Formal Technical reviews(FTR)
• -- Begins at component level and covers entire system
• -- Different techniques at different points
• -- conducted by developer and test group
• -- should include debugging Software testing is one element of verification and
validation.
• Verification refers to the set of activities that ensure that software correctly
implements a specific function. ( Ex: Are we building the product right? )
Validation refers to the set of activities that ensure that the software built is
traceable to customer requirements. ( Ex: Are we building the right product ? )
Testing Strategy
• Testing can be done by software developer and independent testing
group. Testing and debugging are different activities.
• Debugging follows testing Low level tests verifies small code
segments.
• High level tests validate major system functions against customer
requirements
Test Strategies for Conventional
Software:
• Testing Strategies for Conventional Software can be viewed as a spiral
consisting of four levels of testing:
• 1) Unit Testing
• 2)Integration Testing
• 3)Validation Testing and
• 4) System Testing
Testing for Conventional Software
Unit Testing
• Unit Testing begins at the vortex of the spiral and concentrates on
each unit of software in source code. It uses testing techniques that
exercise specific paths in a component and its control structure to
ensure complete coverage and maximum error detection. It focuses
on the internal processing logic and data structures. Test cases should
uncover errors.
Unit Testing
Unit Testing
• Boundary testing also should be done as s/w usually fails at its
boundaries. Unit tests can be designed before coding begins or after
source code is generated.
Unit Test Environment
Unit testing tools
• When we have to find and authenticate the particular module or unit of
the code, we need the unit testing tools. With the help of these tools,
we can build secure design and documentation and decrease the bug
count.
• Generally, unit testing is a manual process, but now some of the
organization has automated the unit test with the help of these tools.
By using unit testing tools, we can cover the maximum coverage,
performance, compatibility, and integration testing.
• All the unit testing tool is implemented as a plug-in for the eclipse. Unit
testing tools are used by the developers to test the source code of the
application or to achieve the source code of the application.
Why perform Unit Testing?
• Unit Testing is important because software developers sometimes try
saving time doing minimal unit testing and this is myth because
inappropriate unit testing leads to high cost defect fixing during
System Testing, Integration Testing and even Beta Testing after
application is built. If proper unit testing is done in early development,
then it saves time and money in the end.
Unit Testing
• Unit tests help to fix bugs early in the development cycle and save
costs.
• It helps the developers to understand the testing code base and
enables them to make changes quickly
• Good unit tests serve as project documentation
• Unit tests help with code re-use. Migrate both your code and your
tests to your new project. Tweak the code until the tests run again.
How to execute Unit Testing
• In order to execute Unit Tests, developers write a section of code to test a specific
function in software application. Developers can also isolate this function to test
more rigorously which reveals unnecessary dependencies between function being
tested and other units so the dependencies can be eliminated. Developers
generally use Unit Test Framework to develop automated test cases for unit
testing.
• Unit Testing is of two types
• Manual
• Automated
• Unit testing is commonly automated but may still be performed manually. Software
Engineering does not favor one over the other but automation is preferred. A
manual approach to unit testing may employ a step-by-step instructional
document.
• Under the automated approach-
• A developer writes a section of code in the application just to test the function.
They would later comment out and finally remove the test code when the
application is deployed.
• A developer could also isolate the function to test it more rigorously. This is a more
thorough unit testing practice that involves copy and paste of code to its own
testing environment than its natural environment. Isolating the code helps in
revealing unnecessary dependencies between the code being tested and other
units or data spaces in the product. These dependencies can then be eliminated.
• A coder generally uses a Unit Test Framework to develop automated test cases.
Using an automation framework, the developer codes criteria into the test to verify
the correctness of the code. During execution of the test cases, the framework logs
failing test cases. Many frameworks will also automatically flag and report, in
summary, these failed test cases. Depending on the severity of a failure, the
framework may halt subsequent testing.
• The workflow of Unit Testing is 1) Create Test Cases 2) Review/Rework 3) Baseline
4) Execute Test Cases.
Unit Testing Techniques
• The Unit Testing Techniques are mainly categorized into three parts which
are Black box testing that involves testing of user interface along with
input and output, White box testing that involves testing the functional
behaviour of the software application and Gray box testing that is used to
execute test suites, test methods, test cases and performing risk analysis.
• Code coverage techniques used in Unit Testing are listed below:
• Statement Coverage
• Decision Coverage
• Branch Coverage
• Condition Coverage
• Finite State Machine Coverage
Unit Test Example: Mock Objects
• Unit testing relies on mock objects being created to test sections of
code that are not yet part of a complete application. Mock objects fill
in for the missing parts of the program.
• For example, you might have a function that needs variables or
objects that are not created yet. In unit testing, those will be
accounted for in the form of mock objects created solely for the
purpose of the unit testing done on that section of code.
Most commonly used tools of unit
testing
NUnit
• One of the most commonly used unit testing tools is NUnit. It is an open-source tool
and initially ported from the JUnit, which works for all .Net languages. NUnit was
written entirely in the C# language and fully redesigned to get the advantage of many
.Net language features. Like custom attributes and other reflection related
capabilities.
• Features of NUnit
• It powerfully supports the data-driven tests.
• In this, we can execute the tests parallelly.
• It allows assertions as a static method of the asset class.
• It uses a console runner to load and execute tests.
• NUnit supports various platforms such as Silverlight, Xamarin mobile, .NET core, and
compact framework.
JUnit
• As opposed to Testing, Debugging is the action where the development team or a developer
implements after receiving the test report related to the bugs in the software from the testing team.
• In the software development process, debugging includes detecting and modifying code errors in a
software program.
• In debugging process, the developer needs to identify the reason behind the particular bug or
defect, which is carried out by analyzing the coding rigorously.
• The developer changes the code and then rechecks whether the defect has been deleted whenever
the bug or error is found.
• Once the debugging is successfully finished, the application is again sent back to the test engineers,
who remain in the process of testing.
• The debugging process allows us an earlier finding of an error and makes software development
stress-free and easy.
• Now, based on features and technique of practice, we can distinguish between Testing and
Debugging.
Testing vs Debugging
S.NO Testing Debugging
1. It is the implementation of the software with the intent of identifying The process of fixing and resolving the defects is known as
the defects debugging.
2. Testing can be performed either manually or with the help of some The debugging process cannot be automated.
automation tools.
3. A group of test engineers executes testing, and sometimes it can be Debugging is done by the developer or the programmer.
performed by the developers.
4. The test engineers perform manual and automated test cases on the The developers will find, evaluates, and removes the software
application, and if they detect any bug or error, they can report back errors.
to the development team for fixing.
5. Programming knowledge is not required to perform the testing Without having an understanding of the programming
process. language, we cannot proceed with the debugging process.
6. Once the coding phase is done, we proceed with the testing process. After the implementation of the test case, we can start the
Debugging process.
7. Software Testing includes two or more activities such as validation and Debugging tries to match indication with cause, hence leading
verification of the software. to the error correction.
8. It is built on different testing levels such as Unit Testing, Integration It is built on different kinds of bugs because there is no such
Testing, System Testing, etc. level of debugging is possible.
9. Software testing is the presentation of defects. It is a logical procedure.
10. Software testing is the vital phase of SDLC (Software Development It is not a part of SDLC because it occurs as a subset of testing.
Life Cycle).
11. •Some advantages of software testing are as below:It can easily •Some advantages of debugging process are as follows:It
understand by the new test engineers or the beginner. supports the developer in minimizing the data.
•The test engineer can interact with software as a real end-user to •If the perform the debugging, we can report the error
check the usability and user interface issues. condition directly.
•It is used to test dynamically altering GUI designs. •During the debugging process, the developer can avoid
•Testing is a cost-effective and time-saving process. complex one-use testing code thathelps the developer save
•Software testing delivers a consistence software. time and energy.
•It will help us to execute the root cause analysis that will enhance the •Debugging delivers maximum useful information of data
software's productivity. structures and allows its informal understanding.
•The testing process also helps detect and fixing the bugs before the
software becomes active, which significantly reduces the risk of
failure.
12. •Software testing contains various type of testing methods, which are •Debugging involves a various type of approaches, which are
as follow:Black-box testing as follows:Induction
•White-box testing •Brute Force
•Grey-box testing •Deduction
DEBUGGING
Software Engineering I
DEBUGGING
• Need for Debugging Once errors are identified in a program code, it is
necessary to first identify the precise program statements responsible
for the errors and then to fix them. Identifying errors in a program
code and then fix them up are known as debugging.
Debugging Approaches
• Debugging Approaches The following are some of the approaches
popularly adopted by programmers for debugging.
• Brute Force Method:
• This is the most common method of debugging but is the least efficient
method. In this approach, the program is loaded with print statements to
print the intermediate values with the hope that some of the printed values
will help to identify the statement in error. This approach becomes more
systematic with the use of a symbolic debugger (also called a source code
debugger), because values of different variables can be easily checked and
break points and watch points can be easily set to test the values of variables
effortlessly.
Debugging Approaches
• Backtracking: This is also a fairly common approach. In this approach, beginning from
the statement at which an error symptom has been observed, the source code is
traced backwards until the error is discovered. Unfortunately, as the number of source
lines to be traced back increases, the number of potential backward paths increases
and may become unmanageably large thus limiting the use of this approach.
• Cause Elimination Method: In this approach, a list of causes which could possibly have
contributed to the error symptom is developed and tests are conducted to eliminate
each. A related technique of identification of the error from the error symptom is the
software fault tree analysis.
• Program Slicing: This technique is similar to back tracking. Here the search space is
reduced by defining slices. A slice of a program for a particular variable at a particular
statement is the set of source lines preceding this statement that can influence the
value of that variable.
Debugging Guidelines
• Debugging is often carried out by programmers based on their ingenuity.
• The following are some general guidelines for effective debugging:
• Many times debugging requires a thorough understanding of the program
design. Trying to debug based on a partial understanding of the system design
and implementation may require an inordinate amount of effort to be put into
debugging even simple problems.
• Debugging may sometimes even require full redesign of the system. In such
cases, a common mistake that novice programmers often make is attempting
not to fix the error but its symptoms.
• One must be beware of the possibility that an error correction may introduce
new errors. Therefore after every round of error-fixing, regression testing must
be carried out.
Program Analysis Tools
• A program analysis tool means an automated tool that takes the
source code or the executable code of a program as input and
produces reports regarding several important characteristics of the
program, such as its size, complexity, adequacy of commenting,
adherence to programming standards, etc.
• We can classify these into two broad categories of program analysis
tools:
• Static Analysis tools
• Dynamic Analysis tools
• Static program analysis tools
Static Analysis Tool
• Static Analysis Tool is also a program analysis tool. It assesses and computes various
characteristics of a software product without executing it. Typically, static analysis
tools analyze some structural representation of a program to arrive at certain
analytical conclusions, e.g. that some structural properties hold.
• The structural properties that are usually analyzed are:
• Whether the coding standards have been adhered to?
• Certain programming errors such as uninitialized variables and mismatch between actual
and formal parameters, variables that are declared but never used are also checked.
• Code walk throughs and code inspections might be considered as static analysis
methods. But, the term static program analysis is used to denote automated analysis
tools. So, a compiler can be considered to be a static program analysis tool.
Dynamic program analysis tools
• Dynamic program analysis techniques require the program to be executed and its actual behavior
recorded. A dynamic analyzer usually instruments the code (i.e. adds additional statements in the
source code to collect program execution traces). The instrumented code when executed allows
us to record the behavior of the software for different test cases. After the software has been
tested with its full test suite and its behavior recorded, the dynamic analysis tool caries out a post
execution analysis and produces reports which describe the structural coverage that has been
achieved by the complete test suite for the program. For example, the post execution dynamic
analysis report might provide data on extent statement, branch and path coverage achieved.
• Normally the dynamic analysis results are reported in the form of a histogram or a pie chart to
describe the structural coverage achieved for different modules of the program. The output of a
dynamic analysis tool can be stored and printed easily and provides evidence that thorough
testing has been done. The dynamic analysis results the extent of testing performed in white-box
mode. If the testing coverage is not satisfactory more test cases can be designed and added to
the test suite. Further, dynamic analysis results can help to eliminate redundant test cases from
the test suite
Conversion Methods
Software Engineering I
Conversion
• It is a process of migrating from the old system to the new one. It
provides understandable and structured approach to improve the
communication between management and project team.
Conversion Plan
• It contains description of all the activities that must occur during
implementation of the new system and put it into operation. It
anticipates possible problems and solutions to deal with them.
• It includes the following activities −
• Name all files for conversions.
• Identifying the data requirements to develop new files during conversion.
• Listing all the new documents and procedures that are required.
• Identifying the controls to be used in each activity.
• Identifying the responsibility of person for each activity.
• Verifying conversion schedules.
Conversion Methods
• The four methods of conversion are −
• Parallel Conversion
• Direct Cutover Conversion
• Pilot Approach
• Phase-In Method
Conversion Methods
Method Description Advantages Disadvantages
Provides fallback when new system Causes cost overruns.
fails. New system may not get fair trail.
Parallel Conversion Old and new systems are used Offers greatest security and
simultaneously. ultimately testing of new system.
Forces users to make new system No fall back if problems arise with
New system is implemented and old work new system
Direct Cutover Conversion Immediate benefit from new Requires most careful planning
system is replaced completely.
methods and control.
Allows training and installation A long term phase in causes a
without unnecessary use of problem of whether conversion
Supports phased approach that resources. goes well or not.
Pilot Approach gradually implement system across Avoid large contingencies from risk
all users management.
Provides experience and line test Gives impression that old system is
Working version of system before implementation erroneous and it is not reliable.
implemented in one part of When preferred new system
organization based on feedback, it is involves new technology or drastic
Phase-In Method changes in performance.
installed throughout the
organization all alone or stage by
stage.
References
• SDLC vs STLC – javatpoint -https://www.javatpoint.com/sdlc-vs-stlc