Friday, 30 November 2012

Test Driven Development – Some practical tips

Test Driven Development – Some practical tips

In an earlier post, I had touched upon TDD very briefly, and promised some practical tips on implementing TDD in a future post. Here they are…

Having managed teams implementing TDD, I have learnt the hard way, that implementing TDD is not a cakewalk; the glamour and hype attached to it notwithstanding. So if you are contemplating on implementing TDD, try the following practical tips:

1) There will be starting-trouble, since this calls for a complete paradigm shift in the minds of the developers. Many of us have grown up hearing and practicing this: Write code, then test. TDD turns that completely topsy-turvy. It says, write a test case (it will obviously fail since it is checking for code which is still not there). Then write code which will just satisfy the test case and make it run (note that the code should do nothing more than barely making the test case run). Then write the next test case, and make it pass by writing the corresponding code. This concept requires some unlearning, so be prepared to add sufficient buffer in your deliverables for implementing this, and don't crucify your developers for taking some extra time in the beginning of your TDD roll-out. This extra time will decrease once they are comfortable with this approach – at that point, they'll reach a desirable mindset where they'll find it difficult to write code without writing test cases, but till then, patience….

2) Better to involve those experienced folks who know Unit Testing (eg. NUnit, JUnit). They would have written test cases after the code was written, and would definitely have faced issues where they've had to refactor the code in order to increase the code coverage from the unit test cases written. This is a constant pain, and TDD removes this by having tests initially, so code-coverage is not an issue (in case you are wondering, 'code-coverage' gives a measure of how much of the codebase is covered/tested by the unit-test-cases-suite).

3) Start with a very small but determined pilot team. Starting with a big team is not really manageable, because of immediate delivery pressures.

4) It is very easy for them to slip back into the traditional way of coding, if there is a schedule pressure, so watch closely for that.

5) Go for a code coverage of about 70-80%…more than that could become an overkill in the initial stages… looks like the Pareto rule is kind-of applicable here too — you can achieve 80% of code coverage with 20% of effort, but the remaining 20% will take about 80% of the effort. Do I have an array of statistics to prove this? Nope…Just a few metrics collected and analyzed from the projects I've worked on, and a gut feeling which has evolved over time. I have seen the enthusiasm die down because of the amount of additional effort needed to cover that last stretch …It will take significant effort from you to rekindle the enthusiasm. So better to aim for about 70-80 % initially, and it has a better chance of working.

6) Its ok to have less unit tests for UI, since UI needs to get covered more by the Functionality/Usability testing. Focus on using TDD more for the sub-strata (layers below the UI).

7) In the middle layer(s), there would be integration points, so be sure not to ignore them, especially if they are part of the critical functionality/logic. Now the question is, we are doing Unit Testing (or in other words, we are notdoing Integration testing), so how do we cater to the integration points, since there would be some chatting between modules/classes. The solution is to use stubs. That is, create stubs which will be called (instead of the actual foreign class/module) by the unit, and return various values, and so the behavior of the unit can be tested based on the different values returned by the stub. Now the point is, writing stubs can be cumbersome. So for that, you could use some third-party API. For eg, there's a very good API for this very purpose, called TypeMock.

What is outlined above is but some of the pitfalls that you need to watch out for, in your journey towards TDD. Happy Test Driving !

Tags:

test driven testing

test driven testing methodology

data driven tests

keyword driven tests

driven dressage tests

test driven development unit testing

test complete data driven testing

test driven development agile

advantages of test driven development

test driven development methodology

test plan driven method

test driven development process

test driven development pdf

test first development methodology

test driven refactoring

advantages of test driven development

test driven development cycle

test driven development testing technique

test driven development unit testing

test driven development private methods




Enterprise Resource Planning (ERP) – The Basics

Enterprise Resource Planning (ERP) – The Basics

Enterprise Resource Planning (ERP) is a business management software that uses a system of integrated applications to run & manage the various businesses of an organization effectively & efficiently. Its a suite of integrated modules built for various functionalities of the organization like Manufacturing, CRM, Supply Chain/Procurement, Finance/Accounting, Human Capital Management, Services etc. All these business functions runs smoothly using the various modules provided by the ERP solution.

Some of the major advantages of using an ERP solution are:

  • Achieve end-to-end view across all business lines
  • Improve performance with upto date information on financial & operational activities
  • Extend global business process using Application integration architecture
  • Reduce back office costs
  • Efficient material management planning
  • Aligning sales channels with corporate objectives
  • Build customer focused applications strategy
  • Manage global processes in localized way
  • BI reports & analytics for better decision making

There are various providers of ERP solution in market with each of them having their pros & cons. An organization should evaluate very carefully the features of every ERP solution against their business needs and technical capabilities. One can start by implementing couple of most important modules like CRM, Manufacturing etc and then go full fledged into it.

You can chose from the below listed major ERP applications which are available in market today:

  • SAP Business All-in-one
  • Oracle EBS
  • Microsoft Dynamics AX
  • Infor10 ERP Enterprise
  • Epicor ERP
  • Sage ERP X3
  • Lawson M3 ERP Enterprise
  • Oracle JDEdwards Enterprise One

Product Testing Vs Application Testing

Product Testing Vs Application Testing

On the surface, there are few differences in terms of skills required to do product testing compared to application testing, except perhaps extra diligence and an eye for detail. However, some of the differences between product and application testing are as follows:

  • Software products need to work on a variety of environments and are expected to work on supported configurations of all supported platforms. This involves running of compatibility tests against supported operating systems and software that must co-exist with the product. This also involves repeating the same tests a number of times and is a fantastic argument for automation.
  • Products must be intuitive to use and work in a similar manner to other products in its domain. Moreover, products are used by a large number of end-users and the way different users use it, is liable to vary. Application users are typically instructed on how to use the application and how not to. Therefore, it's generally alright if an application is shipped with some bugs in it. For products however, usability and stress testing are of utmost importance and it means that there needs to be a user advocate who tests a product with an end-user in mind.
  • Software products also tend to have regular upgraded releases, with enhanced functions which should not break any existing product functionalities. This requires efficient regression testing.
  • The product management team collates frequently changing customer requirements and market expectations of a product, while also contributing to the product roadmap. As a result, the scope of the product changes constantly and testing becomes complicated with daily builds involved.
  • Product management's intervention in scope changes becomes more pronounced in agile environments while management thinks that by using agile the product can be taken to market faster. However, agile testing by itself is a specialized area and with requirements being added or modified constantly, testing becomes a complex process.
  • In some cases, when any bugs are found in a product after a release happens, they are taken as feature additions for the next product version and made as change requirements. In the case of an application, a customer can provide change requirements as bugs and construe it as a gap in understanding the requirements.
  • If a product is to be delivered as a plug-n-play solution to end-users, testing becomes straightforward as there are no multiple configurations and environments involved.

This is just a high-level overview of the differences between product testing and application testing.


Tags:

difference between application testing and product testing

product testing vs application testing

difference between project product testing

difference between mobile testing mobile application testing

difference between software application software product

difference between application development and product development

difference between application testing and system testing

difference between web testing application testing

what is the difference between calling a function and reusing an action

product testing

product testing definition

product testing process

software product testing

application testing

application testing methodologies

application testing process

application testing services

web application testing

software testing

mobile application testing

application testing checklist

application testing tools

Future of Test Automation and infrastructure

Future of Test Automation and infrastructure

Where were we and where are we today in automation?

Software provides the core functionality of most electronics products. These "software-intensive systems" have a large penetration into daily life and this penetration is expected to grow even more in the coming years. In addition to the growth in size and complexity, these software systems need to be of ever increasing quality and need to be developed in ever-shorter time frames. To tackle these increasing quality requirements, testing is an important step in the development of a software-intensive system, as it checks if requirements to a system have not been met. To remain competitive in the development of these systems, industry needs to increase productivity by means of better testing practices.

Starting from the initial stage of testing where automation tools were not available rather the dependency was highly on the unit tests performed by Developers and then manual testing by QA engineer. In Automation we have evolved from Core framework to Record and playback to Custom frameworks. And in custom frameworks, one starts to build the frameworks like Modular framework, Data Driven framework, keyword Driven framework, model based framework and eventually end up with to Hybrid framework solution. However the need has grown from these tool bounded scripts to easily understandable one's, for e.g, like for non-coders like business analysts.

This need gave birth to newer type of framework which has evolved out of the weakness of Test Driven Development (TDD), called Behavior Driven development (BDD). BDD covers the response to the issues encountered in test-driven development:

  • Where to start in the process
  • What to test and what not to test
  • How much to test in one go
  • What to call the tests
  • How to understand why a test fails

BDD covers the 'desired behavior' which has business value for whatever entity commissioned the software unit under construction.  There are many tools which are available in the market to support BDD, such as JBehave, Cucumber and Twist etc. Even after this advancement in testing, the question which still remains at large it, what is there in future for automation? To answer this we need to first understand what is in progress in software industry that requires immediate futuristic attention to address this question.

Smart UI Application Progress

Intelligent applications are aggressively occupying the smart applications running hardware which are now a day's commonly visible on smart phones, PC, TV, games consoles etc. Smart applications such as drawing based, security based, motion sensor based have become new vertical in software development and testing. Due to humongous rise in demands of such devices and software, this has given rise to boom in the software industry. Consequently this has enabled and influenced us to write software for smart mobiles and portable devices.

Software Test automation needs to support smart UI Applications

In order to support such smart UI applications, we definitely need to test them, and in order to test them we definitely need to perform test Automation to eventually support such technology. Consecutively our innovation must also work in this direction of development of such tools which support and drive.

What is expected?

Hence there is need for new level of test automation products that can reduce the cost of implementation and ownership so that you can focus on testing your application instead of developing your tests. These tools should provide a pre-written test framework that can substantially reduce — or even eliminate — the need to learn and use scripting languages.

Such test frameworks, should have the capability to:

  • Make automation accessible to testers who aren't programmers
  • Simplify script development
  • Reduce the maintenance effort

It could be possible that most of these frameworks can be wrapped around one or more existing commercial/freeware test tools, but not always. The primary difference among the products relates to their underlying execution "engine" or script library and whether it is mapped to action words, windows, objects or classes.

Vision for Future of Automation

On following few good practices, the future of test Automation and test automation management can be in good state:

  • Quality of test code should be good for production. Means, Use Private/ Protected member variables /methods. Make them public only when required
  • Traceable and Making Debugging Less Painful

Test automation management tools should ease the process of debugging by providing useful information and have all relevant references in one place.

  • Import only those classes which are required
  • Carefully Use xPath feature, lesser use or avoid Indexes.
  • Keep test data separate from test scripts.
  •  Valuable Reporting

Test automation reporting should be meaningful and flexible to both test engineers and IT managers. An outstanding management tool provides metrics such as trend analysis and key performance indicators for high-level decision making. Meanwhile, it should also have low-level log and statistics that are useful for debugging and internal analysis.

  •  Instant Recognition of Changes in Testing Results

It is essential now to pick up changes in automated test results almost immediately, which requires the management tool to shift information and improve test efficiency.

  •  Compliance with Testing Systems

Easy integration with other systems will help manage different tasks on a single platform.


Tags:


future of automation testing

tools of automation testing

why automation testing is needed

what is meant by automation testing

does automation replace manual testing

automated testing wikipedia

automated software testing

latest trends in test automation

test automation introduction

latest trends in test automation

latest trends process automation

challenges in test automation

benefits of automation testing

why we use automation testing

tools of automation testing

does automation replace manual testing

advantage of automation testing over manual

test automation process