Software Re-engineering

 Software Re-engineering

Software Re-engineering is a process of software development which is done to improve the maintainability of a software system. Re-engineering is the examination and alteration of a system to reconstitute it in a new form. This process encompasses a combination of sub-processes like reverse engineering, forward engineering, reconstructing etc. 

Re-engineering is the reorganizing and modifying existing software systems to make them more maintainable.

Objectives of Re-engineering: 
 

·         To describe a cost-effective option for system evolution.

·         To describe the activities involved in the software maintenance process.

·         To distinguish between software and data re-engineering and to explain the problems of data re-engineering.

Steps involved in Re-engineering: 
 

1.   Inventory Analysis 

2.    Document Reconstruction 

3.    Reverse Engineering 

4.    Code Reconstruction 

5.    Data Reconstruction 

6.    Forward Engineering 
 

Diagrammatic Representation: 

 


 Re-engineering Cost Factors: 

 

·         The quality of the software to be re-engineered

·         The tool support available for re-engineering

·         The extent of the required data conversion

·         The availability of expert staff for re-engineering

Advantages of Re-engineering: 

 

·         Reduced Risk: As the software is already existing, the risk is less as compared to new software development. Development problems, staffing problems and specification problems are the lots of problems which may arise in new software development. 

·         Reduced Cost:  The cost of re-engineering is less than the costs of developing new software.

·         Revelation of Business Rules:  As a system is re-engineered , business rules that are embedded in the system are rediscovered.

·         Better use of Existing Staff: Existing staff expertise can be maintained and extended accommodate new skills during re-engineering.

Disadvantages of Re-engineering: 
 

·         Practical limits to the extent of re-engineering.

·         Major architectural changes or radical reorganizing of the systems data management has to be done manually.

·         Re-engineered system is not likely to be as maintainable as a new system developed using modern software Re-engineering methods. 

Reverse Engineering

Reverse Engineering 

Software Reverse Engineering is a process of recovering the design, requirement specifications and functions of a product from an analysis of its code. It builds a program database and generates information from this. 

The purpose of reverse engineering is to facilitate the maintenance work by improving the understandability of a system and to produce the necessary documents for a legacy system. 

Reverse Engineering Goals: 
 

·         Cope with Complexity.

·         Recover lost information.

·         Detect side effects.

·         Synthesis higher abstraction.

·         Facilitate Reuse.


Steps of Software Reverse Engineering: 

 



1.    Collection Information: 
This step focuses on collecting all possible information (i.e., source design documents etc.) about the software. 

 

2.    Examining the information: 
The information collected in step-1 as studied so as to get familiar with the system. 

 

3.    Extracting the structure: 
This step concerns with identification of program structure in the form of structure chart where each node corresponds to some routine. 

 

4.    Recording the functionality: 
During this step processing details of each module of the structure, charts are recorded using structured language like decision table, etc. 

 

5.    Recording data flow: 
From the information exA tracted in step-3 and step-4, set of data flow diagrams are derived to show the flow of data among the processes. 

 

6.    Recording control flow: 
High level control structure of the software is recorded. 

 

7.    Review extracted design: 
Design document extracted is reviewed several times to ensure consistency and correctness. It also ensures that the design represents the program. 

 

8.    Generate documentation: 
Finally, in this step, the complete documentation including SRS, design document, history, overview, etc. are recorded for future use. 

  

Software Maintenance

Software Maintenance

Software Maintenance is the process of modifying a software product after it has been delivered to the customer. The main purpose of software maintenance is to modify and update software application after delivery to correct faults and to improve performance.

Importance of  Maintenance –
Software Maintenance must be performed in order to:

·         Correct faults.

·         Improve the design.

·         Implement enhancements.

·         Interface with other systems.

·         Accommodate programs so that different hardware, software, system features, and telecommunications facilities can be used.

·         Migrate legacy software.

·         Retire software.

Types of Software Maintenance –

1.      Corrective maintenance:
Corrective maintenance of a software product may be essential either to rectify some bugs observed while the system is in use, or to enhance the performance of the system.

2.      Adaptive maintenance:
This includes modifications and updations when the customers need the product to run on new platforms, on new operating systems, or when they need the product to interface with new hardware and software.

3.      Perfective maintenance:
A software product needs maintenance to support the new features that the users want or to change different types of functionalities of the system according to the customer demands.

4.      Preventive maintenance:
This type of maintenance includes modifications and updations to prevent future problems of the software. It goals to attend problems, which are not significant at this moment but may cause serious issues in future.

Maintenance side-effects

  • Any error or undesirable behaviour that occurs as a result of modifications to a system
     
  • Coding side-effects (inadvertent removal of vital code, changes in semantics of code, unexpected changes in execution path)
     
  • Data side-effects (changes in data structures render older data invalid or incomplete, changes in global constants, changes in data ranges)
     
  • Documentation side-effects (forgetting to document code or data structure changes, changes not reflected in user manuals or interface)

Test Data Generation

 

Test Data Generation

Test Data in Software Testing is the input given to a software program during test execution. It represents data that affects or affected by software execution while testing. Test data is used for both positive testing to verify that functions produce expected results for given inputs and for negative testing to test software ability to handle unusual, exceptional or unexpected inputs.

Test Data Generation

Everybody knows that testing is a process that produces and consumes large amounts of data. Depending on your testing environment you may need to CREATE Test Data (Most of the times) or at least identify a suitable test data for your test cases (is the test data is already created).

Typically test data is created in-sync with the test case it is intended to be used for.

Test Data can be Generated -

  • Manually
  • Mass copy of data from production to testing environment
  • Mass copy of test data from legacy client systems
  • Automated Test Data Generation Tools

Typically sample data should be generated before you begin test execution because it is difficult to handle test data management otherwise. Since in many testing environments creating test data takes multiple pre-steps or very time-consuming test environment configurations. . Also If test data generation is done while you are in test execution phase you may exceed your testing deadline.

Test Data for White Box Testing

In White box testing, test data Management is derived from direct examination of the code to be tested. Test data may be selected by taking into account the following things:

  • It is desirable to cover as many branches as possible; testing data can be generated such that all branches in the program source code are tested at least once
  • Path testing: all paths in the program source code are tested at least once - test data preparation can done to cover as many cases as possible
  • Negative API Testing:
    • Testing data may contain invalid parameter types used to call different methods
    • Testing data may consist in invalid combinations of arguments which are used to call the program's methods

Test Data for Performance Testing

Performance Testing is the type of testing which is performed in order to determine how fast system responds under a particular workload. The goal of this type of testing is not to find bugs, but to eliminate bottlenecks.  An important aspect of Performance Testing is that the set of sample data used must be very close to 'real' or 'live' data which is used on production. The following question arises: ‘Ok, it’s good to test with real data, but how do I obtain this data?’ The answer is pretty straightforward: from the people who know the best – the customers. They may be able to provide some data they already have or, if they don’t have an existing set of data, they may help you by giving feedback regarding how the real-world data might look like. In case you are in a maintenance testing project you could copy data from the production environment into the testing bed. It is a good practice to anonymize (scramble) sensitive customer data like Social Security Number, Credit Card Numbers, Bank Details etc. while the copy is made.

Test Data for Security Testing

Security Testing is the process that determines if an information system protects data from malicious intent. The set of data that need to be designed in order to fully test a software security must cover the following topics:

  • Confidentiality: All the information provided by clients is held in the strictest confidence and is not shared with any outside parties. As a short example, if an application uses SSL, you can design a set of test data which verifies that the encryption is done correctly.
  • Integrity: Determine that the information provided by the system is correct. To design suitable test data you can start by taking an in-depth look at the design, code, databases and file structures.
  • Authentication: Represents the process of establishing the identity of a user. Testing data can be designed as a different combination of usernames and passwords and its purpose is to check that only the authorized people are able to access the software system.
  • Authorization: Tells what are the rights of a specific user. Testing data may contain a different combination of users, roles and operations in order to check only users with sufficient privileges are able to perform a particular operation.

Test Data for Black Box Testing

In Black Box Testing the code is not visible to the tester. Your functional test cases can have test data meeting following criteria -

  • No data: Check system response when no data is submitted
  • Valid data: Check system response when Valid  test data is submitted
  • Invalid data: Check system response when InValid  test data is submitted
  • Illegal data format: Check system response when test data is in an invalid format
  • Boundary Condition Dataset: Test data meeting boundary value conditions
  • Equivalence Partition Data Set: Test data qualifying your equivalence partitions.
  • Decision Table Data Set: Test data qualifying your decision table testing strategy
  • State Transition Test Data Set: Test data meeting your state transition testing strategy
  • Use Case Test Data: Test Data in-sync with your use cases.

Automated Test Data Generation Tools

In order to generate various sets of data, you can use a gamut of automated test data generation tools. Below are some examples of such tools:

DTM Test Data Generator, is a fully customizable utility that generates data, tables (views, procedures etc) for database testing (performance testing, QA testing, load testing or usability testing) purposes.
Datatect is a SQL
 data generator by Banner Software, generates a variety of realistic test data in ASCII flat files or directly generates test data for RDBMS including Oracle, Sybase, SQL Server, and Informix.

 

Stress Testing

 Stress Testing

Stress Testing is a type of software testing that verifies stability & reliability of software application. The goal of Stress testing is measuring software on its robustness and error handling capabilities under extremely heavy load conditions and ensuring that software doesn't crash under crunch situations. It even tests beyond normal operating points and evaluates how software works under extreme conditions.

In Software Engineering, Stress Testing is also known as Endurance Testing. Under Stress Testing, AUT(Application under test) is be stressed for a short period of time to know its withstanding capacity. A most prominent use of stress testing is to determine the limit, at which the system or software or hardware breaks. It also checks whether the system demonstrates effective error management under extreme conditions.

The application under testing will be stressed when 5GB data is copied from the website and pasted in notepad. Notepad is under stress and gives 'Not Responded' error message.

Importance of Stress Testing

Consider the following scenarios - 

  • During festival time, an online shopping site may witness a spike in traffic, or when it announces a sale.
  • When a blog is mentioned in a leading newspaper, it experiences a sudden surge in traffic.

It is imperative to perform Stress Testing to accommodate such abnormal traffic spikes. Failure to accommodate this sudden traffic may result in loss of revenue and repute.

Stress testing is also extremely valuable for the following reasons:

  • To check whether the system works under abnormal conditions.
  • Displaying appropriate error message when the system is under stress.
  • System failure under extreme conditions could result in enormous revenue loss
  • It is better to be prepared for extreme conditions by executing Stress Testing.
Load Testing V/s Stress Testing-

Load Testing

Stress Testing

Load Testing is to test the system behavior under normal workload conditions, and it is just testing or simulating with the actual workload

Stress testing is to test the system behavior under extreme conditions and is carried out till the system failure.

Load testing does not break the system

stress testing tries to break the system by testing with overwhelming data or resources.


Types of Stress Testing:

Distributed Stress Testing:

In distributed client-server systems, testing is done across all clients from the server. The role of stress server is to distribute a set of stress tests to all stress clients and track on the status of the client. After the client contacts the server, the server adds the name of the client and starts sending data for testing.

Application Stress Testing:

This testing concentrate on finding defects related to data locking and blocking, network issues and performance bottlenecks in an application.

Transactional Stress Testing:

It does stress testing on one or more transactions between two or more applications. It is used for fine-tuning & optimizing the system.

Systemic Stress Testing:

This is integrated stress testing which can be tested across multiple systems running on the same server. It is used to find defects where one application data blocks another application.

Exploratory Stress Testing:

This is one of the types of stress testing which is used to test the system with unusual parameters or conditions that are unlikely to occur in a real scenario. It is used to find defects in unexpected scenarios like

1.   A large number of users logged at the same time

2.   If a virus scanner started in all machines simultaneously

3.   If Database has gone offline when it is accessed from a website,

4.   When a large volume of data is inserted to the database simultaneously

How to do Stress Testing?

Stress Testing process can be done in 5 major steps:

1.   Planning the Stress Test. Here you gather the system data, analyze the system, define the stress test goals

2.   Create Automation Scripts: In this phase, you create the Stress testing automation scripts, generate the test data for the stress scenarios.

3.   Script Execution: In this stage, you run the Stress testing automation scripts and store the stress results.

4.   Results Analysis: In this stage, you analyze the Stress Test results and identify bottlenecks.

5.   Tweaking and Optimization: In this stage, you fine-tune the system, change configurations, optimize the code with goal meet the desired benchmark.

Lastly, you again run the entire cycle to determine that the tweaks have produced the desired results. For example, it's not unusual to have to 3 to 4 cycles of the Stress Testing process to achieve the performance goals.

Tools recommended for Stress Testing:

LoadRunner

LoadRunner from HP is a widely-used Load Testing tool. Load Test Results shaped by LoadRunner are considered as a benchmark.

Jmeter

Jmeter is an Open Source testing tool. It is a pure java application for stress and Performance testing. Jmeter is intended to cover types of tests like load, functional, stress, etc. It needs JDK 5 or higher to function.

Stress Tester

This tool provides extensive analysis of the web application performance, provides results in graphical format, and it is extremely easy to use. No high-level scripting is required and gives a good return on investment.

Neo load

This is a popular tool available in the market to test the web and Mobile applications. This tool can simulate thousands of users in order to evaluate the application performance under load and analyze the response times. It also supports Cloud-integrated - performance, load and stress testing. It is easy to use, cost-effective and provides good scalability.