Unit 4 - Software Engineering - WWW - Rgpvnotes.in
Unit 4 - Software Engineering - WWW - Rgpvnotes.in
Unit-4
Coding Standard and Guidelines
Practice of coding style varies with organizations, operating systems and language of coding itself.
The following coding elements may be defined under coding guidelines of an organization:
Naming conventions - This section defines how to name functions, variables, constants and global
variables.
Indenting - This is the space left at the beginning of line, usually 2-8 whitespace or single tab.
Whitespace - It is generally omitted at the end of line.
Operators - Defines the rules of writing mathematical, assignment and logical operators. For example,
assig e t operator = should ha e spa e efore a d after it, as i =2 .
Control Structures - The rules of writing if-then-else, case-switch, while-until and for control flow
statements solely and in nested fashion.
Line length and wrapping - Defines how many characters should be there in one line, mostly a line is 80
characters long. Wrapping defines how a line should be wrapped, if is too long.
Functions - This defines how functions should be declared and invoked, with and without parameters.
Variables - This mentions how variables of different data types are declared and defined.
Comments - This is one of the important coding components, as the comments included in the code
describe what the code actually does and all other associated descriptions. This section also helps
creating help documentations for other developers.
Programming style
Programming style is set of coding rules followed by all the programmers to write the code. When multiple
programmers work on the same software project, they frequently need to work with the program code
written by some other developer. This becomes tedious or at times impossible, if all developers do not follow
some standard programming style to code the program.
An appropriate programming style includes using function and variable names relevant to the intended task,
using well-placed indentation, commenting code for the convenience of reader and overall presentation of
code. This makes the program code readable and understandable by all, which in turn makes debugging and
error solving easier. Also, proper coding style helps ease the documentation and updating.
Code Sharing
Programming interfaces of present-day languages are very sophisticated and are equipped huge library
functions. Still, to bring the cost down of end product, the organization management prefers to re-use the
code, which was created earlier for some other software. There are huge issues faced by programmers for
compatibility checks and deciding how much code to re-use.
Code Review
A code review is a process where two or more developers visually inspect a set of program code, typically,
several times. The code can be a method, a class, or an entire program. The main code-review objectives are:
1. Best Practice -A more efficient, less error-prone, or more elegant way to accomplish a given task.
2. Error Detection -Discovering logical or transitional errors.
3. Vulnerability Exposure -Identifying and averting common vulnerabilities like Cross-Site Scripting [XSS],
Injection, Buffer Overflow, Excessive Disclosure, etc.
4. Malware Discovery -This often-overlooked and very special code-review objective looks for segments
of code that appear extraneous, questionable, or flat-out weird. The intent is to discover back doors,
Troja s, a d ti e o s. I toda s orld ale ole t ode is a er real threat a d should ot e
overlooked, especially by Government agencies.
Rapid Prototyping
It is also called close-ended prototyping. Throwaway or Rapid Prototyping refers to the creation of a model
that will eventually be discarded rather than becoming part of the final delivered software. After preliminary
requirements gathering is accomplished, a simple working model of the system is constructed to visually show
the users what their requirements may look like when they are implemented into a finished system.
Specialization
Specialization learns to solve complex software engineering problems combining analysis, design,
Develop and evaluate comprehensive software test plans at both the software module and the
interface for software projects.
Analyze and manage software configuration to ensure conformance to Total Quality Assurance
systems level.
Design and implement a user interface for a software system in order to maximize its usability.
standards.
Construction
Software construction is a software engineering discipline. It is the detailed creation of working meaningful
software through a combination of coding, verification, unit testing, integration testing, and debugging. It is
linked to all the other software engineering disciplines, most strongly to software design and software testing.
Search Suitable Components - The software component repository is referred by designers to search
for the matching component, on the basis of functionality and intended software requirements..
Incorporate Components - All matched components are packed together to shape them as complete
software.
Debugging
It is a systematic process of spotting and fixing the number of bugs, or defects, in a piece of software so that
the software is behaving as expected. Debugging is harder for complex systems in particular when various
subsystems are tightly coupled as changes in one system or interface may cause bugs to emerge in another.
Debugging is a developer activity and effective debugging is very important before testing begins to increase
the quality of the system. Debugging will not give confidence that the system meets its requirements
completely but testing gives confidence.
To execute test suites and individual test cases following the test procedures.
Test execution has the following major task:
To re-execute the tests that previously failed in order to confirm a fix. This is known as confirmation
testing or Re-testing.
When all the information has been gathered which are needed for the testing.
also like:
Strategic Issues
• Specify product requirements in a quantifiable manner before testing starts.
• Specify testing objectives explicitly.
• Identify categories of users for the software and develop a profile for each.
• Develop a test plan that emphasizes rapid cycle testing.
• Build robust software that is designed to test itself.
• Use effective formal reviews as a filter prior to testing.
• Conduct formal technical reviews to assess the test strategy and test cases.
• Develop a continuous improvement approach for the testing process.
2
Ensures that the software system meets Ensures that the functionalities meet the intended
all the functionality. behavior.
3
Verification takes place first and includes
the checking for documentation, code, Validation occurs after verification and mainly
etc. involves the checking of the overall product.
4 Done by developers. Done by testers.
Test Plan: -
A Software Test Plan is a document describing the testing scope and activities. It is the basis for formally
testing any software/product in a project. Test planning, the most important activity to ensure that there is
initially a list of tasks and milestones in a baseline plan to track the progress of the project. It also defines the
size of the test effort.
TEST TECHNIQUES: -
White Box Testing
White box testing is a testing technique that examines the program structure and derives test data from the
program logic/code. The other names of glass box testing are clear box testing, open box testing, logic driven
testing or path driven testing or structural testing.
Statement Coverage - This technique is aimed at exercising all programming statements with minimal
White Box Testing Techniques:
Branch Coverage - This technique is running a series of tests to ensure that all branches are tested at
tests.
Path Coverage - This technique corresponds to testing all possible paths which means that each
least once.
Expensive as one has to spend both time and money to perform white box testing.
Disadvantages of White Box Testing:
Equivalence Class
There are different techniques involved in Black Box testing.
Unit Testing
Unit testing is a level of software testing where individual units/ components of a software are tested. The
purpose is to validate that each unit of the software performs as designed. A unit is the smallest testable part
of software. It usually has one or a few inputs and usually a single output. In procedural programming a unit
may be an individual program, function, procedure, etc.
Integration Testing
Integration Testing is a level of software testing where individual units are combined and tested as a group.
The purpose of this level of testing is to expose faults in the interaction between integrated units.
Integration testing is defined as the testing of combined parts of an application to determine if they function
correctly. Integration testing can be done in two ways: Bottom-up integration testing and Top-down
integration testing.
System testing is the first step in the Software Development Life Cycle, where the application is tested
System testing is important because of the following reasons:
The application is tested thoroughly to verify that it meets the functional and technical specifications.
as a whole.
The application is tested in an environment that is very close to the production environment where the
System testing enables us to test, verify, and validate both the business requirements as well as the
application will be deployed.
application architecture.
System Testing: -It is a black box testing technique performed to evaluate the complete system the system's
compliance against specified requirements. In System testing, the functionalities of the system are tested from
an end-to-end perspective.
System Testing is usually carried out by a team that is independent of the development team in order to
measure the quality of the system unbiased. It includes both functional and Non-Functional testing. The fig.-
4.2 is shown as:-
Performance
Scalability
Stress
System Test Types
Load and Stability
Reliability
Regression
Fig:-4.2-System Testing
Acceptance Testing
When the software is ready to hand over to the customer it has to go through last phase of testing where it is
tested for user-interaction and response. This is important because even if the software matches all user
Alpha testing - The team of developer themselves perform alpha testing by using the system as if it is
requirements and if user does not like the way it appears or works, it may be rejected.
being used in work environment. They try to find out how user would react to some action in software
Beta testing - After the software is tested internally, it is handed over to the users to use it under their
and how the system should respond to inputs.
production environment only for testing purpose. This is not as yet the delivered product. Developers
expect that users at this stage will bring minute problems, which were skipped to attend.
Maintenance Activities
IEEE provides a framework for sequential maintenance process activities. It can be used in iterative manner
and can be extended so that customized items and processes can be included. The fig.-4.3 is shown as:-
These activities go hand-in-hand with each of the following phase:
Identification & Tracing - It involves activities pertaining to identification of requirement of
modification or maintenance. It is generated by user or system may itself report via logs or error
messages. Here, the maintenance type is classified also.
Analysis - The modification is analyzed for its impact on the system including safety and security
implications. If probable impact is severe, alternative solution is looked for. A set of required
modifications is then materialized into requirement specifications. The cost of
modification/maintenance is analyzed and estimation is concluded.
Design - New modules, which need to be replaced or modified, are designed against requirement
specifications set in the previous stage. Test cases are created for validation and verification.
Implementation - The new modules are coded with the help of structured design created in the design
step. Every programmer is expected to do unit testing in parallel.
System Testing - Integration testing is done among newly created modules. Integration testing is also
carried out between new modules and the system. Finally the system is tested as a whole, following
regressive testing procedures.