Software Testing Practices, Test Methodologies and Test Competency Services


Welcome to the world of Software Testing & Best Test Practices.

All you wanted to know about Software Testing, Test Practices, Test Methodologies and building the Test Competency Services !!


Wednesday, October 3, 2012

7 Mistakes in Software Testing

Trial and error method is the best way of testing, but repeatedly not fixing of errors would ruin the efforts taken in testing and is a mere waste of time. Software Testing engineers while testing make small mistakes unintentionally which seems to be insignificant but are of high importance.
The following are the mistakes we usually find in software testing:
The First Mistake: Unit Testing is a method by which smallest testable part of an application of source code are tested to determine if they are fit for use. By just calling all utility methods, it's easy to test a utility class, passing some values and examining if the expected result is returned. A first mistake arises here. Majority of the developers don't think out of the box, or not adequate. Developers can test that 1 + 1 =2, that 2 + 1 = 3 and that 3 + 1 = 4. But what is the use of doing nearly 3 times the same test? Testing boundary cases is better. Are the arguments of the sum ( ) method primitive types or Objects? If they are Objects, what happens if you pass null values? If an exception is thrown, is that the expected one? Does it clearly tell what the problem is?
The Second Mistake: Mocks - For example the service layer is unit tested, all other components like the DAO layer should be mocked. Manually in many cases it's been done. That's the second mistake. It's much better to use mocking frameworks because when one mocks stuff manually the mocks are tightly coupled to the implementation as they are made for it. Just believe that they will create the mocks the way they want. Some mocking frameworks are capable of doing more than others; some are easier to use than others. Some of the best mocking framework is Mockito and EasyMock. Mockito is preferred because of its power and simplicity and EasyMock is by far the best known but it's a bit complex too to use. So it's not only a matter of choosing a mocking framework. It's also a matter of choosing the right one.
The Third Mistake: Integration Tests are the tests over different integrated parts of an application while unit tests only tests a LUW (logical unit of work). In integration tests - the best known type of are tests of the DAO layer. In these tests, multiple things are validated: The input parameters, The use of the ORM tool The correctness of the generated query (functional) If the DB can be accessed The fact that the query is working and The fact that the correct ResultSet is returned. The third mistake that is made often is that in the dbUnit XML dataset developers provide test data. Most of the time this data has no representation of live data; the best way to handle this is to make functional-providing people and maintaining this test data. Because one doesn't want to make them struggle with a specific XML format, good practice is to use the XlsDataSet format (Excel Sheet).
The Fourth Mistake: Functional Tests are forgotten too often because the perception is that they are difficult and expensive to maintain. It's true that we'll have to tweak to make them maintainable but executing all the same tests manually over and over again will cost much more. Also when functionality is tested and automated by means of continuous integration, there's no need for stress for screens/ functionality that will be broken in the next release. Selenium is a great framework that is able to record functionality in the browser. The fourth mistake is made here. Most people will just record and replay the tests the way they are. Selenium--HTML components by their HTML id can be tracked. If developers don't specify id's in their HTML code, they can easily change if a page is updated. This will break the tests immediately even when functionality still works.
The Fifth Mistake: This mistake is made in a JUnit test by just pasting the recorded test. Login and logout are common functionalities, the time to wait for a response, should be added to a superior level. For example, a login can be done before each test, afterwards a logout is done. This way, if something changes in login or logout functionality, tests won't break.
The Sixth Mistake: Absence of testing logical flows sixth mistake happens. It's perfectly possible that an insert, a search, an update, and a delete work on their own but that the complete flow from the creation, search, and update until delete of the same entry won't work. The great way to group multiple tests and run them in sequence all together is by the TestSuites.
The Seventh Mistake: BDD (Behavior Driven Design) Instead of functional tests most of the tests are technical tests. To test logical behavior than to test if the things work technically is much more important. That can be done by means of Behavior Driven Design. Given some things, when an event occurs, then what should be the outcome? Mockito has some great stuff to easily write tests in a BDD way.

Thinking Tester

White box and Black box is all we have heard about testing since its origin. There is no tester who is without the knowledge of these testing boxes. But trying things in different perspective to see whether they really work is an art of creative thinking were people come out with their new ideas apart from the default ones.
Some ideas given below, if implemented will make you think out of the box and optimize your testing modules to much greater extent.
1) Creating Test Cases Preparing a gist of ideas and scenarios you may come across while testing, penning it down and repeating the process till you make a good number of content. When the same is reviewed at the end and you will be surprised to see with new ideas you have come out with.
2) Cross testing ideas Use refreshed ideas while testing a new application. Treat it like an entirely new application before you test, you may come across new scenarios and by doing this you may find shortcuts for testing an application which you have not dealt with.
3) Backward Testing Ideas Requirements>> Unit Cases >> Integration Testing >> System Testing is the default way of testing. Instead for a change, try using the reversed order like System Testing>>Integration Testing>>Unit Cases >>Requirements.
Eg: Requirement says you can upload a file which does not exceed file size of 10 MB. The most testers will follow uploading a 1MB, 2MB, 3 MB and so on till 10 MB is reached or error message is displayed. Why not start with 10MB and then try 11MB and then 9 MB. This example is nothing but a BVA but how many of us have tried using BVA in scenarios other than an input box.
4) Questioning Questioning enhances the domain knowledge of the tester. Having an attitude of questioning will not allow the tester to stay negligent even with a small bug. Also the tester can get to know well about his purpose of testing.
5) Researching Making a detail study about the product you are going to test is necessary, therefore make as much as research possible by comparing and interpreting the results you get with the earlier results.
6) What about a cup of coffee How about a cup of coffee in between your testing process or a stroll in the office just before fixing a bug, sounds relaxing? One of the time consuming process is testing were testers need to stick on to the process till the bug is fixed. So at least, gaze out of your window to slow down, unwind and freshen up before getting your hands dirty in process of fixing the bug.
7) Talented Tester who are highly talented with a go get attitude will have innovative ideas of testing and they will not compensate their work at any cause and this will obviously yield them a good result.
8) Working with Multiple disciplines Manual, Functional, Performance testing skills and soft skills like Leadership skills, Communication skills, are some of the other areas a tester should work on. These extra talents will help testers to have a balanced growth both, professionally and personally.
9) Importance of Clients Testers should always work with client,s perspective. Make sure each and every demand of the client is met before delivering their product. This one deed will take a long way in your relationship with them.
10) Interest for finding new ways Testers must act desperate in finding new ways for testing. Working with passion will help you to find new ways of testing.

Difference between Functional and Non Functional Testing


Let us have a look at the major difference between Functional and Non Functional Testing.



Functional Testing:


A type of black box testing, functional testing tests an application against the business requirements. Testers can either use automated tools or manual testing tools to verify the function of the code. Listed below are 5 Steps to remember in Functional testing:


1.    Based on the specifications of functions, it involves preparing test data.

2.    The inputs to functional testing are the business requirements.
3.    The output of the functions has to be verified against the functional specifications.
4.    Executing test cases.
5.    Verify the output against the expected output.

The below listed testing are the sub types of Functional Testing.


1.    Unit Testing:
Unit testing is very useful to detect bugs and defects right at the beginning of the software development life cycle.
2.    Smoke Testing:
Smoke Testing or Build Verification Testing consist of a set of non-exhaustive tests which ensures that the most vital functions work.
3.    Sanity testing:
An unscripted type of test, sanity testing focuses on few functional areas of an application.
4.    Integration testing:
Integration testing tests an application as a whole to detect if there are any defects in the interaction between the integrated units of the application.
5.    Usability Testing:
An evaluation method, unit testing is used to ensure that the user is satisfied with the application.

The other sub-types of Functional testing are:


1.    Interface Testing

2.    System Testing
3.    Regression Testing
4.    User Acceptance Testing

Non-Functional Testing


Non-Functional Testing, tests an application against the non-functional requirements. These include the quality of the product.  A tester can test the non-functionality of an application after he/she has tested the application against the functional requirements. Listed below are they sub-types of Non-Functional Testing:


1.    Compatibility Testing:
This type of testing evaluates the compatibility of an application with a computing environment.
2.    Load Testing/Stress Testing:
It is important for a tester to check if the application/website can withstand the load and stress when there are many people assessing it at the same time.
3.    Recovery Testing:
Testers will need to check the capability of an application to recover after experiencing hardware failure or crashes.
4.    Security Testing:
Security is important especially when it comes to applications that require a user to enter critical information such as account or credit card information. Testers have to ensure that such information is being transmitted safely.
5.    Volume Testing:
The functions of volume testing are often misunderstood or used interchangeable. It refers to testing an application’s performance with a specific amount of data.

The other sub-types of Non-Functional testing are:


1.    Availability Testing

2.    Baseline Testing
3.    Compliance Testing
4.    Configuration Testing
5.    Documentation Testing
6.    Endurance Testing
7.    Ergonomics Testing
8.    Interoperability Testing
9.    Installation Testing
10.    Localization Testing and Internationalization Testing
11.    Maintainability Testing
12.    Operational Readiness Testing
13.    Performance Testing
14.    Reliability Testing
15.    Resilience Testing
16.    Scalability Testing
17.    Usability Testing