Thursday 22 November 2018

Basic knowledge of JUnit for new programmers and testers

Image result for junit


What is JUnit?
JUnit is a unit testing framework for the programs written in Java programming language. Testing is a process to check the functionality of an application to see that it is working as per the requirements. To ensure this thing at a developer level, unit testing is done. Unit testing is a testing of single entity i.e. class or method. Unit testing is very essential to each and every software company to give a quality product to their customers.

JUnit is important tool for software development using test-driven development. JUnit is one of the family of unit testing frameworks which are collectively known as xUnit that originated with JUnit. JUnit is an open source testing framework which is used to write and run repeatable automated tests, so that the developers can ensure that the code works as expected. JUnit is widely used in industry and can be used as stand alone Java program i.e. from the command line or within an Eclipse IDE.

JUnit provides assertions for testing expected results. In simple meaning an assertion is a statement in Java that enables us to test the assumptions about the program. Each such assertion contains a Boolean expression that the developer believe will be true when the assertion executes. Besides this, JUnit also provides test features for sharing common test data and test suites for easily organizing and running tests. It contains both graphical as well as textual test runners.

JUnit is used to test an entire object or a part of part of an object i.e. a method or some interacting methods. It can also be used to test interaction between several objects. JUnit promotes the idea of first testing then coding, that emphasizes to set up a test data for a piece of code which can be tested first and can then be implemented. The approach is to test a little then code a little again test a little and so on. This technique increases programmer’s productivity and the stability of the program code. This overall reduces the programmer stress and time spent on debugging.

Why to use JUnit?
JUnit ensures that the code works as intended. It ensures that having a high test coverage of the code allows the programmer to continue developing features without having to perform lots of manual tests. 

Also, JUnit allows programmers to write code faster while increasing code quality. It is also very simple to use JUnit and takes less time to execute tests. JUnit tests can be run automatically and it can check the results and also provide a feedback. So there is no need to manually look at the test results. Hence, it is better to use automation testing tool for performing unit tests. If the test needs to be done for Java programming then we need to use JUnit automation unit testing tool to test the Java program.

Who uses JUnit?
The other question that arises that arises is that who needs to perform unit testing i.e. the developers or the testers. The answer is JUnit is mostly used by developers. JUnit is used to perform unit testing, which is a coding process rather than a testing. But there are many testers or Quality Assurance engineers that use JUnit tool to perform unit testing.

Features of JUnit
  • JUnit is used for writing and running tests.
  • JUnit provides annotation to identify the test methods.
  • JUnit provides assertions for testing results expected by the programmer.
  • JUnit provides test runners for running tests.
  • JUnit allows programmer to write code faster with increasing quality.
  • JUnit is very simple to use and takes very less time for executing tests.
  • JUnit can be run automatically and it can check own results and provide immediate feedback.
  • JUnit test can be organized into test suites containing test cases and even other test suites.
  • JUnit has a test progress bar that is green in color if test goes fine and it turns red when the test fails.

Tools similar to JUnit
Java developers mostly prefer the JUnit testing framework, Jenkins continuous integration server and Git version control system. There was a survey conducted which reveals that most of the developers are using JUnit, making it the most used single technology across the entire Java landscape. But there are couple of new frameworks and testing tools also available. They are Arquillian, JTest, The Grinder, TestNG, JWalk, Mockito and Powermock. 

Pros of JUnit
  • Quick and easy generation of test cases and test data
  • Ability to reuse older test cases as well as test data for making a new test case
  • It enhances productivity and reduces production cost
  • It promotes and supports Test Driven Development
  • Excellent and comprehensive reporting technique
  • It is supported by almost all IDE’s
  • Any new member in the development team can easily understand the test cases written and managed using JUnit
Cons of JUnit
  • JUnit only tests the functionality of the unit themselves. It cannot check for errors that occur on integration level.
  • It cannot detect performance issues and memory leaks
Conclusion
JUnit is the most popular testing framework in Java. It is supported by almost all the IDE’s. It provides a very simple and flexible support for a developer to make sure that the code written is robust since it helps to identify the defects in the initial stage of the development. The more number of unit test done on the code, the better is the final developed application. It is very useful in a Test Driven Development approach. Also, multiple tests can be clubbed into a single test suite.

Saturday 17 November 2018

Hadoop: The Future of Big Data in the Enterprise



Big data is one of the topics that I find very interesting and is in strong demand in IT industry. Big data is nothing but a colossal amount of data generated by machines. First, the employees used to generate data and put it into computer systems. A few years later things evolved to the internet and users started generating their own data by signing up on various sites and inputting their own information. Now, various electronic devices are accumulating many different kinds of data. So many processors are brought to the data to process these data. The framework used to process these data is called Hadoop.

Hadoop is an open source software project that enables the distributed processing of large data sets across clusters of commodity servers. Hadoop is very scalable since new data can be added as needed without needing to change data formats. It is also very cost effective since it uses parallel computing and decrease the cost of storage. Hadoop can store any type of data, be it structured or unstructured from any types of sources. It is also fault tolerant as the system redirects work to another location of data and continues processing it whenever a node is lost. Hadoop is basically used to store massively large amount of data and to process these data at a much faster speed.


It is advised that you learn the Hadoop framework since the post of Data Analyst is one of the most reputed in Computer Science domain and it will be in strong demand in coming years. According to umbel.com the big data revenue has nearly quadrupled in the last three years and shows no signs of slowing down. This is because hardware costs are falling dramatically as software and services make up an increasing part of big data revenue. It is in strong demand because more and more businesses are getting into big data game.

It does not have a competitor since more enterprises will adopt a data driven business and will look to Hadoop to support their growth. The focus on Hadoop is only going to create more opportunities for new entrants in the market, to rise and solve its challenges. The eweek.com predicts that by 2020, Hadoop will be used by world-class enterprises, as well as businesses of all sizes for managing, processing and leveraging data to serve their better.
Hadoop works by providing a thin abstraction over local data storage and synchronization, allowing programmers to concentrate on writing code for analyzing the data. Besides Hadoop, it is also advised that you learn a tool called Ambari. It is a tool that can be used to provision, manage and monitor a cluster of Hadoop jobs.

Many big companies such as Yahoo, Amazon, Facebook and Twitter are using Hadoop. Companies such as Platfora, Alpine Data Labs and Altiscale are the hot Hadoop startups based in California, says cio.com.

In short, learning Hadoop will gain you Statistical Analysis and Data Mining skills, which is one of the top skills that the recruiters are looking for. Also, by looking at Hadoop job trends on indeed.com, it can be seen that there is a huge rise in the amount of job postings. Hence in the coming years, Hadoop will be the future of the big data in the enterprise.

Wednesday 14 November 2018

Fancy Testing methods that you might have not heard of




There are some other software testing methods which you might not have heard of; also called as fancy testing methods. Each of the methods belong to different level of testing such as unit test, integration test, system test, acceptance test and stand-alone test.

Smoke Testing
It is a type of testing that is carried out by different software testers to check the stability of the new build provided by the development team. In this, the major functionality of the software is tested for its expected working so that the team can carry on further and detailed testing. Smoke testing is done as a stand-alone testing.

Sanity Testing
It is similar to smoke testing and is carried out by testers as well as developers. It is done to check that the software, environment, network and external systems are up and running. Sanity test is often done without being documented and is done as a unit test and integration test.

Soak Testing
It is a type of performance testing, in which the software is subjected to load over a significant duration of time. Testing can go on for days and even weeks. It is done to find errors that result in degeneration of software performance with continuous usage. It is also referred as endurance testing.

Parallel Testing
It is done to compare the result of one test against another. It includes testing of same software or different software. It is done as a stand-alone test.

Regression Testing
The objective of regression test is to find defects that were introduced while fixing defects or addition of new features. It is also done as a stand-alone test.

Big-Bang Testing
It is a type of integration testing in which the testing is done for all the modules coupled together.

Fuzz Testing
It is a software testing technique, which involves testing with unexpected or random inputs. Software is then monitored for failures or error messages that are generated due to input errors.

Gorilla Testing
It is a type of software testing that is done to exercise one or few functionality thoroughly by having multiple people test the same functionality.

Scenario Testing
It is performed as a acceptance test to test the system with realistic test cases that simulate the problem domain.

Monkey Testing
It is done as a stand-alone testing. It this technique, testing is performed on the system under test randomly. The input data is generated randomly and keyed into the system for testing.

References:

Tuesday 13 November 2018

Scaling and improving the quality in Agile Testing using the TMMi





The main focus of this topic is combining the agile and Test Maturity Model Integration (TMMi). But before we discuss the merging of agile and TMMi, let us first discuss about what is agile and TMMi separately.

What is agile?
The word agile derives from the agile manifesto. Agile methodology is an alternative to traditional project management, which is typically used for developing the software. It helps teams respond to unpredictability through incremental and iterative software development called as sprints. Agile methodologies are an alternative to waterfall, or traditional sequential development.
The agile manifesto says that you need to prefer interactions between the developers and the stakeholders instead of the traditional method of some process and uses of tools. It only focusses on working software over the complex documentation approach. It also focusses on customer communication over negotiation of contract. Also, it can quickly respond to the software changes while the traditional software development approach was not able to do any changes in the software since the software was developed using a plan.

What is agile testing?
Agile testing is a software testing practice, that follows the principles of agile software development. Agile testing involves all the members of an agile team, with special expertise contributed by testers, to ensure delivering the business value desired by the customer. It ensures that the customer realizes the quality of the software at frequent intervals and the agile testing is done quickly.

Benefits of agile testing
Agile development and testing improves the software quality and the whole development team is responsible for this. It ensures that there is a better communication between the software tester and the developer. They can work together to improve the software. Also, in agile all the team is working together, and hence if there are any defects or flaws in the software system it can be easily fixed. Since agile testing is done at the start of the software development, there are very fewer changes and fixes that needs to be done. Also, it flexible enough to incorporate new software requirements.

What is TMMi?
It stands for Test Maturity Model Integration. It is a staged assessment model just like CMM and CMMi. It follows similar assessment and ratings process like CMMi. It consists of five levels such as initial, managed, defined, measurement and management and optimization.

Why to use TMMi model?
TMMi supports testing activities and improvement in test process systems and software engineering. It also addresses all the test levels and focusses on moving organizations from defect detection to defect prevention. It identifies the opportunities for significant savings in the cost of developing the software. It is the international standard to measure the test maturity. It also supports risk management, monitoring and control.

Benefits of TMMi
It helps deliver the projects on time and to budget. It reduces the overall fault levels and development and test costs.

Scope of TMMi
It supports testing activities and test process improvements in both the systems and software engineering. It supports both the lower test levels and higher test levels in terms of dynamic testing. The TMMi proves to be an excellent model for use during software assessment. The assessment contains various requirements such as formal assessments, quick scans and self-assessments. It also provides a full framework for test process improvement.

TMMi maturity levels



It has five levels of maturity. They are the shorthand way for describing the organizational capability. The five levels are:

 1. Initial — It represents the starting point in the TMMi. Organizations in the Initial state have not institutionalized the processes that are called for in the TMMi model. This level has no process areas.

2. Managed — It defines five specific process areas that delineate testing from the development process of debugging. It creates a basic testing capability that includes the definition of testing, processes for planning, designing, executing and controlling testing in a defined testing environment. The five process areas are:
 — Test Policy and Strategy, Test Planning, Test Monitoring and Control, Test Design and Execution, Test Environment

3. Defined — It includes the practices that are required to extend testing (or verification and validation) across the life cycle of development based common standards and processes. This maturity level includes five process areas. They are:
 — Test Organization, Test Training Program, Test Life Cycle and Integration, Non-functional Testing, Peer Reviews

4. Measured — It focuses on gathering data and the measurement of the testing processes. Measurement provides information needed to begin improving the testing process and product quality. Measurement can provide many benefits. The Measured process area includes three process areas. They are:
 — Test Measurement, Product Quality Evaluation, Advanced Reviews

5. Optimization — This is the final level of the TMMi framework. Optimization reflects an organizational state where quantitative process improvement is refined to maximize effectiveness and efficiency. Maturity Level Five includes three process areas. They are:
— Defect Prevention, Quality Control, Test Process Optimization

Combination of Agile and TMMi
In the presentation titled TMMi and agile considerations on quality in agile, Stevan Zivanovic explains that how the two models work together to enable a repeatable approach to quality. He says that the agile practices can easily map into the TMMi levels. Agile practices enforce a high quality output if followed in a sequential model. Agile needs to deliver right level of quality to meet the customer needs. TMMi is not a perspective model and it looks for appropriateness to the project, program and organization in a number of critical areas. It is a method of measuring how well you embed your testing on quality practices. Hence, the agile and the TMMi model do fit well together.

The model is useful to any development approach and it does not look for specific documents. It looks for thoughtful and considered actions to ensure that everyone concerned understands what things to be done. It does not prescribe the practice of continuously evaluating to make effective changes. It can lead to specific benefits in agile that drives to a common goal of a consistent repeatable approach on how you perform the agile practices. For well run agile team the direct benefit is to fine-tune the process. TMMi can be used to access key issues in a consistent manner and it provides a prioritized plan as to what needs to be implemented first.

The point here is that the TMMi and agile do fit together. TMMi uses appropriateness and fit for purpose measures. It is not bound by processes and hence can work with any development methodology. It is an important tool for defining and prioritizing improvements across the whole organization. TMMi supports high quality structures that institutionalizes and prioritizes the practices to ensure a quality deliverable.

Hence, when both the models are used together, the quality of the software is improved. Also the combination, if used at right time helps to deliver the quality repeatedly.