0% found this document useful (0 votes)
31 views17 pages

Se Mod - 3

Uploaded by

Sambit Swain
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)
31 views17 pages

Se Mod - 3

Uploaded by

Sambit Swain
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/ 17

STRUCTURED ANALYSIS AND DESIGN

The purpose of Design phase in the Software Development Life Cycle is to


produce a solution to a problem given in the SRS(Software Requirement
Specification) document. The output of the design phase is Software Design
Document (SDD).
Basically, design is a two-part iterative process. First part is Conceptual
Design that tells the customer what the system will do. Second is Technical
Design that allows the system builders to understand the actual hardware
and software needed to solve customer’s problem.
Modularization: Modularization is the process of dividing a software system
into multiple independent modules where each module works independently.
There are many advantages of Modularization in software engineering.
Some of these are given below:

• Easy to understand the system.


• System maintenance is easy.
• A module can be used many times as their requirements. No need
to write it again and again.
Coupling: Coupling is the measure of the degree of interdependence
between the modules. A good software will have low coupling.

• Data Coupling: If the dependency between the modules is based


on the fact that they communicate by passing only data, then the
modules are said to be data coupled. In data coupling, the
components are independent to each other and communicating
through data. Module communications don’t contain tramp data.
Example-customer billing system.
• Stamp Coupling In stamp coupling, the complete data structure is
passed from one module to another module. Therefore, it involves
tramp data. It may be necessary due to efficiency factors- this
choice made by the insightful designer, not a lazy programmer.
• Control Coupling: If the modules communicate by passing control
information, then they are said to be control coupled. It can be bad
if parameters indicate completely different behaviour and good if
parameters allow factoring and reuse of functionality. Example- sort
function that takes comparison function as an argument.
• External Coupling: In external coupling, the modules depend on
other modules, external to the software being developed or to a
particular type of hardware. Ex- protocol, external file, device
format, etc.
• Common Coupling: The modules have shared data such as global
data structures. The changes in global data mean tracing back to all
modules which access that data to evaluate the effect of the
change. So it has got disadvantages like difficulty in reusing
modules, reduced ability to control data accesses and reduced
maintainability.
• Content Coupling: In a content coupling, one module can modify
the data of another module or control flow is passed from one
module to the other module. This is the worst form of coupling and
should be avoided.

Cohesion: Cohesion is a measure of the degree to which the elements of


the module are functionally related. It is the degree to which all elements
directed towards performing a single task are contained in the component.
Basically, cohesion is the internal glue that keeps the module together. A
good software design will have high cohesion.

Types of Cohesion:

• Functional Cohesion: Every essential element for a single


computation is contained in the component. A functional cohesion
performs the task and functions. It is an ideal situation.
• Sequential Cohesion: An element outputs some data that
becomes the input for other element, i.e., data flow between the
parts. It occurs naturally in functional programming languages.
• Communicational Cohesion: Two elements operate on the same
input data or contribute towards the same output data. Example-
update record in the database and send it to the printer.
• Procedural Cohesion: Elements of procedural cohesion ensure
the order of execution. Actions are still weakly connected and
unlikely to be reusable. Ex- calculate student GPA, print student
record, calculate cumulative GPA, print cumulative GPA.
• Temporal Cohesion: The elements are related by their timing
involved. A module connected with temporal cohesion all the tasks
must be executed in the same time-span. This cohesion contains
the code for initializing all the parts of the system. Lots of different
activities occur, all at unit time.
• Logical Cohesion: The elements are logically related and not
functionally. Ex- A component reads inputs from tape, disk, and
network. All the code for these functions is in the same component.
Operations are related, but the functions are significantly different.
• Coincidental Cohesion: The elements are not related(unrelated).
The elements have no conceptual relationship other than location in
source code. It is accidental and the worst form of cohesion. Ex-
print next line and reverse the characters of a string in a single
component.

User Interface Design


The visual part of a computer application or operating system through which a client
interacts with a computer or software. It determines how commands are given to the
computer or the program and how data is displayed on the screen.
Types of User Interface
There are two main types of User Interface:

o Text-Based User Interface or Command Line Interface


o Graphical User Interface (GUI)

Text-Based User Interface: This method relies primarily on the keyboard. A typical
example of this is UNIX.

Advantages

o Many and easier to customizations options.


o Typically capable of more important tasks.

Disadvantages

o Relies heavily on recall rather than recognition.


o Navigation is often more difficult.

Graphical User Interface (GUI): GUI relies much more heavily on the mouse. A typical
example of this type of interface is any versions of the Windows operating systems.

7.7M
175
Exception Handling in Java - Javatpoint

GUI Characteristics

Characteristics Descriptions

Windows Multiple windows allow different information to be displayed simultaneously on the


user's screen.

Icons Icons different types of information. On some systems, icons represent files. On other
icons describes processes.

Menus Commands are selected from a menu rather than typed in a command language.

Pointing A pointing device such as a mouse is used for selecting choices from a menu or indicating
items of interests in a window.

Graphics Graphics elements can be mixed with text or the same display.
Advantages

o Less expert knowledge is required to use it.


o Easier to Navigate and can look through folders quickly in a guess and check
manner.
o The user may switch quickly from one task to another and can interact with
several different applications.

Disadvantages

o Typically decreased options.


o Usually less customizable. Not easy to use one button for tons of different
variations.

Command Line Interface (CLI)


CLI has been a great tool of interaction with computers until the video display
monitors came into existence. CLI is first choice of many technical users and
programmers. CLI is minimum interface a software can provide to its users.
CLI provides a command prompt, the place where the user types the command and
feeds to the system. The user needs to remember the syntax of command and its
use. Earlier CLI were not programmed to handle the user errors effectively.
A command is a text-based reference to set of instructions, which are expected to be
executed by the system. There are methods like macros, scripts that make it easy for
the user to operate.
CLI uses less amount of computer resource as compared to GUI.

CLI Elements
A text-based command line interface can have the following elements:
• Command Prompt - It is text-based notifier that is mostly shows the context
in which the user is working. It is generated by the software system.
• Cursor - It is a small horizontal line or a vertical bar of the height of line, to
represent position of character while typing. Cursor is mostly found in blinking
state. It moves as the user writes or deletes something.
• Command - A command is an executable instruction. It may have one or more
parameters. Output on command execution is shown inline on the screen.
When output is produced, command prompt is displayed on the next line.

Graphical User Interface


Graphical User Interface provides the user graphical means to interact with the
system. GUI can be combination of both hardware and software. Using GUI, user
interprets the software.
Typically, GUI is more resource consuming than that of CLI. With advancing
technology, the programmers and designers create complex GUI designs that work
with more efficiency, accuracy and speed.

GUI Elements

GUI provides a set of components to interact with software or hardware.


Every graphical component provides a way to work with the system. A GUI system
has following elements such as:
• Window - An area where contents of application are displayed. Contents in a
window can be displayed in the form of icons or lists, if the window represents
file structure. It is easier for a user to navigate in the file system in an exploring
window. Windows can be minimized, resized or maximized to the size of
screen. They can be moved anywhere on the screen. A window may contain
another window of the same application, called child window.
• Tabs - If an application allows executing multiple instances of itself, they
appear on the screen as separate windows. Tabbed Document Interface has
come up to open multiple documents in the same window. This interface also
helps in viewing preference panel in application. All modern web-browsers use
this feature.
• Menu - Menu is an array of standard commands, grouped together and placed
at a visible place (usually top) inside the application window. The menu can be
programmed to appear or hide on mouse clicks.
• Icon - An icon is small picture representing an associated application. When
these icons are clicked or double clicked, the application window is opened.
Icon displays application and programs installed on a system in the form of
small pictures.
• Cursor - Interacting devices such as mouse, touch pad, digital pen are
represented in GUI as cursors. On screen cursor follows the instructions from
hardware in almost real-time. Cursors are also named pointers in GUI
systems. They are used to select menus, windows and other application
features.

Application specific GUI components

A GUI of an application contains one or more of the listed GUI elements:


• Application Window - Most application windows uses the constructs supplied
by operating systems but many use their own customer created windows to
contain the contents of application.
• Dialogue Box - It is a child window that contains message for the user and
request for some action to be taken. For Example: Application generate a
dialogue to get confirmation from user to delete a file.

• Text-Box - Provides an area for user to type and enter text-based data.
• Buttons - They imitate real life buttons and are used to submit inputs to the
software.

• Radio-button - Displays available options for selection. Only one can be


selected among all offered.
• Check-box - Functions similar to list-box. When an option is selected, the box
is marked as checked. Multiple options represented by check boxes can be
selected.
• List-box - Provides list of available items for selection. More than one item can
be selected.
Other impressive GUI components are:

• Sliders
• Combo-box
• Data-grid
• Drop-down list

User Interface Design Activities


There are a number of activities performed for designing user interface. The process
of GUI design and implementation is alike SDLC. Any model can be used for GUI
implementation among Waterfall, Iterative or Spiral Model.
A model used for GUI design and development should fulfill these GUI specific steps.

• GUI Requirement Gathering - The designers may like to have list of all
functional and non-functional requirements of GUI. This can be taken from
user and their existing software solution.
• User Analysis - The designer studies who is going to use the software GUI.
The target audience matters as the design details change according to the
knowledge and competency level of the user. If user is technical savvy,
advanced and complex GUI can be incorporated. For a novice user, more
information is included on how-to of software.
• Task Analysis - Designers have to analyze what task is to be done by the
software solution. Here in GUI, it does not matter how it will be done. Tasks
can be represented in hierarchical manner taking one major task and dividing
it further into smaller sub-tasks. Tasks provide goals for GUI presentation.
Flow of information among sub-tasks determines the flow of GUI contents in
the software.
• GUI Design & implementation - Designers after having information about
requirements, tasks and user environment, design the GUI and implements
into code and embed the GUI with working or dummy software in the
background. It is then self-tested by the developers.
• Testing - GUI testing can be done in various ways. Organization can have in-
house inspection, direct involvement of users and release of beta version are
few of them. Testing may include usability, compatibility, user acceptance etc.

GUI Implementation Tools


There are several tools available using which the designers can create entire GUI on
a mouse click. Some tools can be embedded into the software environment (IDE).
GUI implementation tools provide powerful array of GUI controls. For software
customization, designers can change the code accordingly.
There are different segments of GUI tools according to their different use and
platform.

Example

Mobile GUI, Computer GUI, Touch-Screen GUI etc. Here is a list of few tools which
come handy to build GUI:

• FLUID
• AppInventor (Android)
• LucidChart
• Wavemaker
• Visual Studio

SOFTWARE TESTING

Software Testing is evaluation of the software against requirements gathered from


users and system specifications. Testing is conducted at the phase level in software
development life cycle or at module level in program code. Software testing
comprises of Validation and Verification.

Software Validation
Validation is process of examining whether or not the software satisfies the user
requirements. It is carried out at the end of the SDLC. If the software matches
requirements for which it was made, it is validated.

• Validation ensures the product under development is as per the user


requirements.
• Validation answers the question – "Are we developing the product which
attempts all that user needs from this software ?".
• Validation emphasizes on user requirements.

Software Verification
Verification is the process of confirming if the software is meeting the business
requirements, and is developed adhering to the proper specifications and
methodologies.

• Verification ensures the product being developed is according to design


specifications.
• Verification answers the question– "Are we developing this product by firmly
following all design specifications ?"
• Verifications concentrates on the design and system specifications.
Target of the test are -
• Errors - These are actual coding mistakes made by developers. In addition,
there is a difference in output of software and desired output, is considered as
an error.
• Fault - When error exists fault occurs. A fault, also known as a bug, is a result
of an error which can cause system to fail.
• Failure - failure is said to be the inability of the system to perform the desired
task. Failure occurs when fault exists in the system.

Manual Vs Automated Testing


Testing can either be done manually or using an automated testing tool:
• Manual - This testing is performed without taking help of automated testing
tools. The software tester prepares test cases for different sections and levels
of the code, executes the tests and reports the result to the manager.
Manual testing is time and resource consuming. The tester needs to confirm
whether or not right test cases are used. Major portion of testing involves
manual testing.
• Automated This testing is a testing procedure done with aid of automated
testing tools. The limitations with manual testing can be overcome using
automated test tools.
A test needs to check if a webpage can be opened in Internet Explorer. This can be
easily done with manual testing. But to check if the web-server can take the load of 1
million users, it is quite impossible to test manually.
There are software and hardware tools which helps tester in conducting load testing,
stress testing, regression testing.

Testing Approaches
Tests can be conducted based on two approaches –

• Functionality testing
• Implementation testing
When functionality is being tested without taking the actual implementation in concern
it is known as black-box testing. The other side is known as white-box testing where
not only functionality is tested but the way it is implemented is also analyzed.
Exhaustive tests are the best-desired method for a perfect testing. Every single
possible value in the range of the input and output values is tested. It is not possible
to test each and every value in real world scenario if the range of values is large.

Black-box testing
It is carried out to test functionality of the program. It is also called ‘Behavioral’ testing.
The tester in this case, has a set of input values and respective desired results. On
providing input, if the output matches with the desired results, the program is tested
‘ok’, and problematic otherwise.

In this testing method, the design and structure of the code are not known to the
tester, and testing engineers and end users conduct this test on the software.
Black-box testing techniques:
• Equivalence class - The input is divided into similar classes. If one element of
a class passes the test, it is assumed that all the class is passed.
• Boundary values - The input is divided into higher and lower end values. If
these values pass the test, it is assumed that all values in between may pass
too.
• Cause-effect graphing - In both previous methods, only one input value at a
time is tested. Cause (input) – Effect (output) is a testing technique where
combinations of input values are tested in a systematic way.
• Pair-wise Testing - The behavior of software depends on multiple parameters.
In pairwise testing, the multiple parameters are tested pair-wise for their
different values.
• State-based testing - The system changes state on provision of input. These
systems are tested based on their states and input.

White-box testing
It is conducted to test program and its implementation, in order to improve code
efficiency or structure. It is also known as ‘Structural’ testing.

In this testing method, the design and structure of the code are known to the tester.
Programmers of the code conduct this test on the code.
The below are some White-box testing techniques:
• Control-flow testing - The purpose of the control-flow testing to set up test
cases which covers all statements and branch conditions. The branch
conditions are tested for both being true and false, so that all statements can
be covered.
• Data-flow testing - This testing technique emphasis to cover all the data
variables included in the program. It tests where the variables were declared
and defined and where they were used or changed.

Testing Levels
Testing itself may be defined at various levels of SDLC. The testing process runs
parallel to software development. Before jumping on the next stage, a stage is tested,
validated and verified.
Testing separately is done just to make sure that there are no hidden bugs or issues
left in the software. Software is tested on various levels -

Unit Testing
While coding, the programmer performs some tests on that unit of program to know
if it is error free. Testing is performed under white-box testing approach. Unit testing
helps developers decide that individual units of the program are working as per
requirement and are error free.

Integration Testing
Even if the units of software are working fine individually, there is a need to find out if
the units if integrated together would also work without errors. For example, argument
passing and etc.

System Testing
The software is compiled as product and then it is tested as a whole. This can be
accomplished data updation using one or more of the following tests:
• Functionality testing - Tests all functionalities of the software against the
requirement.
• Performance testing - This test proves how efficient the software is. It tests
the effectiveness and average time taken by the software to do desired task.
Performance testing is done by means of load testing and stress testing where
the software is put under high user and data load under various environment
conditions.
• Security & Portability - These tests are done when the software is meant to
work on various platforms and accessed by number of persons.

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 requirements and if user does not like
the way it appears or works, it may be rejected.
• Alpha testing - The team of developer themselves perform alpha testing by
using the system as if it is being used in work environment. They try to find out
how user would react to some action in software and how the system should
respond to inputs.
• Beta testing - After the software is tested internally, it is handed over to the
users to use it under their 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.

Regression Testing
Whenever a software product is updated with new code, feature or functionality, it is
tested thoroughly to detect if there is any negative impact of the added code. This is
known as regression testing.
CYCLOMATIC COMPLEXITY
Cyclomatic complexity is a source code complexity measurement that is being
correlated to a number of coding errors. It is calculated by developing a Control Flow
Graph of the code that measures the number of linearly-independent paths through
a program module.
Lower the Program's cyclomatic complexity, lower the risk to modify and easier to
understand. It can be represented using the below formula:
Cyclomatic complexity = E - N + 2*P
where,
E = number of edges in the flow graph.
N = number of nodes in the flow graph.
P = number of nodes that have exit points

Example :
IF A = 10 THEN
IF B > C THEN
A = B
ELSE
A = C
ENDIF
ENDIF
Print A
Print B
Print C

MUTATION TESTING

Mutation testing is a type of white box testing that is performed to design


new software tests and also evaluate the quality of already existing software
tests. Mutation testing is related to modification a program in small ways. It
focuses to help the tester develop effective tests or locate weaknesses in the
test data used for the program.

Mutation testing can be applied to design models, specifications, databases,


tests, and XML. It is a structural testing technique, which uses the structure
of the code to guide the testing process. It can be described as the process
of rewriting the source code in small ways in order to remove the
redundancies in the source code.
Types of Mutation Testing:
Mutation testing is basically of 3 types:
1. Value Mutations:
In this type of testing the values are changed to detect errors in the
program. Basically a small value is changed to a larger value or a
larger value is changed to a smaller value. In this testing basically
constants are changed.
2. Decision Mutations:
In decisions mutations are logical or arithmetic operators are
changed to detect errors in the program.
3. Statement Mutations:
In statement mutations a statement is deleted or it is replaces by
some other statement.
FlowGraph:

The Cyclomatic complexity is calculated using the above control flow diagram that
shows seven nodes(shapes) and eight edges (lines), hence the cyclomatic
complexity is 8 - 7 + 2 = 3

You might also like