Advantages of Unit Testing

Earlier we had discussed about the role of unit testing in software development, today we are going to discuss what the benefits of unit testing are. These points will make you understand how creating unit test cases may make a difference in developing good software and a great one.

Benefits of Unit testing

1) Unit testing improves the quality of the code. At unit testing level developer is able to identify every bit of defect which may have aroused, before code is sent further for integration testing. Hence a high level of software quality assurance is achieved.

2) With successful unit testing of the modules of a software, we can easily demonstrate the progress of the developing application. We can actually show how many modules are not only developed but are tested without bug.

3) Mostly, developers who have created the module, do the unit testing on it. So they first frame the test cases and then start developing it. This keeps developer more focused and helps him do better coding.

4) Bugs detected at earlier stage are easier to be fixed. Hence, unit testing minimizes the possibilities of the bugs at higher level of testing like Integration testing and system testing.

5) Unit testing actually saves tester’s time and effort.

6) Unit testing gives confidence to the developing team.

7) Modules whose unit testing has been done successfully can be reused by the developer.

8) It helps in developing better software design. By creating unit test plans, developer is forced to investigate and understand the functionality of the said module with respect to large scheme of things. This way he can design this module’s functionality better without any redundancy.

Hope given these advantages you, as a developer, will start using Unit testing as a tool to improve your coding skills.

You may also like to read:
Testing v/s Debugging
Exhaustive Testing In Software Testing?
Advantages and Disadvantages of EDI
What is Software Bug ? Defect Life Cycle Explained

Copyright ©

Unit Testing in Software Testing

What do you mean by unit testing?

Unit testing is a type of testing where an individual unit of the software is being tested rather than the software as a whole. A unit is the smallest testable entity of a software. The unit testing is performed on individual module of the software so that the software is tested thoroughly and to ensure each unit works as per the specifications given by the user. Unit testing enables a developer to determine if a particular unit is fit to be used further in the software code and is not redundant.

Below mentioned tests are performed while doing Unit testing:

1) Basis Path testing: Each and every control flow in the lines of code is tested to determine the set of linearly independent paths. Basis on these set of linear paths test cases are generated. Test cases ensure that each of the identified paths have been executed at least once.

2) Boundary testing: Many software fail at the boundary value e.g. extreme values of the "for loop". By determining the boundary values of the unit of the software, we check whether the module fails or passes the test and how it behaves at these extreme values.

3) Data flow testing: In this, the correctness of the data flow logic in the module is tested. Points where variable receive values and how they use it is checked during this type of unit testing.

4) Local data structure: In this, we check the integrity of local variables stored in the code and they are not altered in-evidently.

5) Error handling path: Tests are performed in the module to check whether proper handling is done in the modules or not.
white box testing, softwaretestinghelp
Different types of Unit testing

When is Unit testing performed ?

Unit testing is performed at the initial level of testing phase. The smallest part of a software is known as a Unit. So before testing the whole software at once, it is crucial to test a single module properly. Hence, we can minimize errors while integrating different small modules.

wiki software testing types
Different stages of software testing

Who performs Unit Testing?

Unit testing is performed by the software developer who has developed the software or his/her peers. Sometimes on rare occasions it can be performed by the testers.

How Unit Testing is performed ?

Unit testing is performed with help of Stub and drivers. Before understanding how unit testing is performed let us understand what a Stub and Driver is. As we all know that individual modules cannot function independently and it is difficult to test them individually also. So we have the concept of Stub and Driver. For each of the modules tester develops stub and driver.

Driver: Driver is the main program that invokes modules to be tested.
Stub: Stub is the module that is called by the module to be tested.

Let us understand this with help of diagram.
Drivers and Stubs Example, testing driver stub, module testing
Driver and stub in unit testing

Driver is the program through which the module (whose unit testing is being performed) is invoked or called .Test cases’ data is passed to the modules through the driver.
Stubs are the programs which are called by the module being tested, the test data are passed to the stubs with the help of the module and once the data are processed through the stub, the program control goes back to the module and result is returned to the module.
Next we will discuss the benefits of unit testing.

You may also like to read:
Testing v/s Debugging
What is Exhaustive Testing In Software Testing?
Advantages and Disadvantages of Outsourcing Testing Activity
What is Software Bug ? Defect Life Cycle Explained

Copyright ©

What is Software Bug ? Defect Life Cycle Explained

Software Bug

A software bug is a fault in a software program which can produce unexpected outcome or terminates the program unexpectedly. If bug is not handled properly in the software, it may lead to haphazard results. These bugs may occur due to error in the source code or in proper design of the program. Sometimes these bugs may be inconsequential but in some critical operations these bugs may lead to major unwanted effects.

Following are the real-life examples wherein software bugs have had disastrous effects:
1) The hole in ozone layer of Antarctica remained undetected for long period of time because the software designed for mapping the values for ozone layer deviated to a large extend from expected. There was a bug in the data. Eventually, when the data was reviewed the error was exposed.
2) Many of the helicopter crashes have happened in the past because of a system bug. In 1994 in Scotland, a Chinook helicopter crashed and almost 29 passengers were killed because of the system error which was exposed in an inquiry conducted to inspect the mishap.

We all develop softwares which are used in the real world, so it is very important to test the software carefully so that we can save our money and lives.

Software Defect

One of the important phases in software development is testing. Software testers are given several test cases and when the output of any test case scenario deviates from expected result, the tester raises a defect. Eventually, the development team works on the defects to remove bugs from the software.
There are several tools which are used for raising and maintaining defects. One of the popular examples is HP Quality Centre.

Classification of Defects

Defects can be classified on the basis of various parameters

1. Severity wise classification

1) Severity 1 / Critical
Severity 1 defects cause the system to crash or close abruptly. It needs to be fixed on priority.
2) Severity 2 / High
Severity 2 defects can cause failure of some of the major functionality of the software.
3) Severity 3 / Low
Severity 3 defects will not cause failure in the execution of any of the functionalities of the software.

2. Error wise classification

1) Database error
Database error occurs when incorrect data is caught in the database or if database is not accessible to a particular module of code.
2) Design error
When the designing of the software is not appropriate or there are some missing contents in the design.
3) Ambiguous Design error
No content is missing in the design but the placement of the content is ambiguous. Due to such error developers are not able to fully understand the requirements of the customer and end up developing something which doesn’t meet customer’s needs.
4) Logic Error
Logical error is caught in the execution of any of the functionality of the software e.g. a wrong formula to calculate some figures.
5) Performance Error
Error related with performance of the code. For instance, any of the servers installed for the execution of application causes more utilization of the CPU.

Defect Life Cycle

Software Bug Life Cycle & Guidelines, Process Bug Life Cycle Stages
Life Cycle of a Defect
Defect life cycle is the life cycle of the defect when it is caught during testing till it is resolved and closed at the end.
1) New
When the defect is raised for first time, its status is saved as New in HP Quality Centre.
2) Assign
When the defect is raised in HP Quality Centre, it is declared as a valid defect by the lead of tester team then the defect is assigned to the developer for fixing.
3) Open
In this stage, the developer starts working on fixing of the defect.
4) Fixed
In this stage, the developer has tested the faulty code and fixed the code. He will send the code again to testing team to retest it.
5) Retest
In this stage, the tester team again retests the changed code and checks whether the code is still faulty or not. Testing also checks that changed code hasn’t had any adverse effect on other modules.
6) Closed
Once the code has been fixed and verified by the testing team, then the defects can be closed and the code can be sent to the live production environment.
7) Reopened
If the code fixed by the developer is still faulty and the bug has been caused during retesting then the particular defect is reopened.
8) Rejected
If the developer feels that the defect is invalid and the test scenario is working as expected then he can change the status of the defect to “rejected”.
9) Duplicate
If the bug is duplicated then the defect is marked as duplicate in the HP tool.
10) Deferred
Defect can be marked as deferred if the bug is of low severity and can be fixed in next releases.

I hope you got your doubts on software bug and defect life cycle cleared, next up we will learn about unit testing and integration testing.

You may also like to read:
Difference between Testing and Debugging
Exhaustive Testing: What is exhaustive testing?
Benefits and Drawbacks of Outsourcing Testing Activity

Copyright ©

EDI: Benefits and Drawbacks of Electronic Data Interchange

EDI Definition

EDI stands for Electronic Data Interchange. EDI is an exchange of data or business documents between two or more businesses using a standardized electronic format, without human intervention. It is mostly used by large businesses to carry out their business process over a secured network with accuracy and in less time.

Below are some examples of common business transactions/documents which are often shared by different companies.
1) Purchase order (PO)
2) Sales order(SO)
3) Invoice
4) Advance Ship Notice (ASN)
5) Functional Acknowledgement

Each company has their own format of sending these documents. Suppose we have two companies A and B. Company A sends its purchase order (PO) to company B. As the format of the document is different for the Company B, it will manually read the data from PO sent by Company A and creates a Sales order (SO) from it in order to carry out further processes. EDI provides the data exchange formats and reduces the manual intervention in the process.
Let us understand how electronic data interchange works with help of a diagram
Electronic Interchange, EDI software, provider, translation
Working of EDI process

By using EDI, we can provide speed and accuracy to the information being sent from one business to another. In EDI enabled systems, everything is fully automated with less human intervention.
Moreover, in the given example, EDI system allows Company A to select the vendors, plan the production schedules electronically and create purchase order (PO) automatically. The errors involved here are minimal as there is less human involvement. When the PO reached at Company B end, the EDI helps to create Sales order (SO) automatically without any human involvement of creating Sales Order from PO send by Company A.

Standardized EDI format
Below are some of the examples of EDI standard format used by different organizations-

1) UN/EDIFACT standard
It is basically used for administration, Commerce and Transport. It is developed under UNITED NATIONS (UN) in 1987.

It is used by health care, insurance, government and transportation. It is chartered American National Standards Institute (ANSI) in 1979.

3) GS1 EDI
It is used by Supply chain process for carrying out processes like Order, Dispatch Advice (Shipping Notice), Invoice, Transport Instruction, etc.

It is used by UK retail sector. It contains transaction like Product information file, Price information file, the customer Information file, the order file and many more operations.

5) HL7
It provides standard format for exchange of information related with retrieval of electronic health information.

Let us now look at various advantages and disadvantages of Electronic Data Interchange.

Benefits of EDI

1)  Expedite transmission
Information is transmitted from one organization to another organization efficiently and swiftly.

2)  Automated Data entry
Data is entered automatically by EDI software. For instance, when purchase order (PO) from one company is received by another company. Sales order (SO) is automatically generated at other company’s system with the help of EDI software.

3)  Receipt verification
Receipt verification can easily be done with help of EDI software. No human intervention is involved so there are minimal chances of error or delay.

4)  Data Validation
Data validation is automatically done.

5)  Availability of free software
Free softwares are available depending upon the EDI format chosen. For example- In TRADACOMS EDI format, Price Information file and order files are available for free.

6)  Low cost
Lower administrative, resource and maintenance cost.

7)  Faster processing
With the help of EDI, business processes can be executed at a much faster rate as compared to the traditional method sending information.

8)  Building long-term relationships
EDI helps in building long term relationships with trading partners and hence helps in business growth.

9)  Reduction in error
EDI has discarded manual data entry and paperwork. So there are minimal chances of error.

Drawbacks of EDI

1)  Expensive
Setup and maintenance of some of the formats of EDI is expensive.

2)  Initial setup is time consuming
Initial cost to setup EDI is time consuming.

3)  EDI standard changes
The business process depends on EDI standard format. If any of the standard format changes then the business process has to be changed accordingly.

4)  System electronic protection
An EDI enabled system needs electronic protection from viruses, hacking, malware and other frauds.

5)  Staff training cost
Staff needs training in order to run EDI enabled software. Investment has to be done in training.

6)  Proper backup should be maintained as the whole data depends on EDI. In case of any crash of EDI system, proper backup has to be maintained and extra cost is required for it.

7)  Limit your trading partners
Some organization stops doing business which don’t use EDI. For instance, Wal-Mart prefers to do business only with those organization which uses EDI.

What is the market scenario for EDI and its competition?

The demand of EDI is very high. Businesses are actually rejecting other business as they don’t use EDI. Trading partners are offering discount if they get converted into EDI.
Since EDI contains both data and data schema in the same file. It is simpler for the programmer to provide EDI solutions. EDI implementation is simpler for any organization as it is faster and leads to lower cost.
EDI has been proven to be reliable, affordable and easy to use amongst all types of businesses. It is the best source for creating business relations with other businesses.
Electronic Interchange started with food and cars industries and it was successful. Then in 1996, the medical industry started using EDI for its application and after that it became popular. EDI has a good scope for the future and fulfills all the needs of the customer. EDI businesses and tools will evolve for smart devices and will always be demanding.

You may also like read :
Beginner's Guide to insurance
Shocking Myths about Credit Cards
Earned Value Management Terms and Formulas
Copyright ©

Difference between Revolving Credit and Overdraft

While reading about credit cards, you might have come across the term revolving credit often. Today I will try to explain what revolving credit is and how it is different from overdraft facility.

Revolving Credit or Revolver

Think of a scenario wherein you are allowed to take a loan amounting to a specified sum from a bank in lieu of a commitment fee. But, you have an option to select the number of installment payment cycles as well as the installment amount in each of these cycles. Isn't it a dream come true for any debtor? I think yes. And this is exactly what revolving credit is. This loan can be withdrawn, repaid, redrawn any number of times until the contract ends. Sounds familiar?? Yes, Credit cards are examples of revolving credit.

In this facility, banks determine the maximum limit of credit facility to be provided to an individual or corporation depending on their credit worthiness. Once this upper limit has been finalized, the bank enters a contract with the borrower, wherein the borrower agrees to pay off this loans and interest rates (if applicable) during the contract term. The borrower can withdraw loans any number of times and pay them off depending on his capabilities anytime. This repayment too can be partial or in full and depends on the borrower. The available credit is directly dependent on the amount of money borrowed and subsequently repaid.  Small businesses use this facility from lending institutions for financing their capital expansion needs or to help them during rough financial periods.

Caution: Higher interest rates and penalty charges may be applied under some conditions.

Bank Overdraft

In bank overdrafts you are given the facility by the bank to withdraw a sum over and above the balance available in your account. In return of this withdrawal, the bank charges a fixed interest and you have to repay the amount due within a year. Above the interest, banks can charge you an annual overdraft fee as well. Having overdraft facility will ensure that the check issued by you doesn’t bounce as bank will take care of it. In other words we can say that bank overdraft is when the account balance becomes negative.

Revolving Credit vs Overdraft

In revolving credit, the biggest benefit one gets is that he can take a loan anytime, anywhere without going through the hassle of applying for it each time. You can use this facility for any purchase, small or big. But with all the benefits of “revolver”, you also have to take care of one of the biggest hazard of such type of lending – the terms of credit are never clear or fixed. You need to really dig into the terms and conditions section to ensure that you don’t get a rude shock later on. In case of overdraft, all the terms are pretty straight forward with respect to interest rates and annual fees agreed upon upfront with no unnecessary clauses.
Overdrafts are a far better and easy way to be in control of your expenses as against the temptations of revolving credit.

Bottom Line: Both revolving credit facility and overdraft facility are good for people to keep their finances in control. While organizations and small businesses prefer overdrafts, retail users go for revolving credit.
Before finalizing which one to get, read all the terms and conditions and seek help from your financial adviser.

Fun Fact: Revolving Credits are also known as ‘evergreen’ loans.

Read More:
List of Common Myths about Credit Cards
12 Common Credit Card Mistakes You Should Avoid
How Do Credit Cards Affect Credit Score
What all is covered under Car Insurance?

  Copyright ©