Monday, November 23, 2009

26 Hints for Agile Software Development

I collect nuggets of wisdom on various topics. Recently I have been going over the topic of Agile software development; what really matters? Below is a list of 26 key principles to guide an agile software development team.
Get case 1 fully working before starting case 2.
Another way of saying this to use a kitchen metaphor is: “Serve the current meal before starting to cook the next“. The biggest problem with software development is to start a bunch of things in parallel, because inevitably work will include something that is later discarded, meaning wasted work. Work on one case; get it fully functional; get the tests running; write the documentation; check it all in as a finished piece of work, before you start on the next case.
Never break the build. Pretty obvious, but must be included in any list of software development advice. A programmer who is taking all the proper precautions to test before checking in will never break the build. If the build is broken, it is always because someone took a shortcut.

Never implement a routine before it is needed in a use case. When implementing a particular class, you should have a particular use case in mind, and you should implement only the methods required for that use case. You might think about the potential for other capabilities on a class, and you might document this in a comment, but implementation should wait until it is actually needed in a use case.
Never add a data member before it is needed in a use case. Exactly like above except with regard to class data members. It may seem obvious that a “customer” record will need a “ship to address”, but that ship to address should not be implemented until you have a use case which specifically needs it.
Don’t be afraid to make a decision; don’t be afraid to change an earlier decision. Agile development is about responding to uncertainty and quickly responding. Early in development you do not have complete information. You should delay decisions as long as possible, but there comes a time that a decision is needed to move forward. You can not hold up decision until that information comes in. Instead, make the best decision you can on the available information. Later, when new information arrives, don’t be afraid to change that decision. (Some dinosaurs call this flip-flopping, but I call it reacting to a changing environment.)

Continually learn how to improve quality. This job never ends, so you should expect to be constantly on the look out for things that could be improved, and collect examples of ways that quality problems were identified and addressed.

Measure, measure, measure. Agile development is help address the problem of uncertainty about the future, but there should be no uncertainty about the past. Tests should be continually running. Performance of every run should be measured and recorded.

Design around people, not systems. Too often developers get sidetracked into designing for technical opportunities. You should never lose sight of the ultimate purpose of the software, and that is to help people get work done.

Tests are part of the product. Many developers and managers consider the product to be what you ship to the customer, and everything else less important. The tests should be considered an actual part of the product, worthy of full consideration during design, and even, in many cases, delivered with the product to the customer. (This latter part is controversial, but a built-in self-test as part of a software delivery takes inconsequential space, and yet provide tremendous benefit when needed. Such an approach should be considered.)

Write the test before the code. The test itself can be used to clarify the design for exactly what is needed. Many times there are flaws in the design approach which are discovered when working through the test cases. Think how much time would be saved to work through those cases before coding. But: write the test for case1, and code for case 1, before starting case 2.

Eliminate Waste. Frankly, another ubiquitous platitude which must be included in any list of development principles because it is so important. There is no end to the job of looking for waste where it exists and eliminating it. Eliminate anything that does not add value to the actual customer. If you can not identify the value to the customer, then you probably don’t need it.
Build a culture of immediate response to build breakage. Understand that when the build is broken, it effect everyone in the project, and so there is nothing more important than making sure that the central core code is building and testing properly. I have seen teams that allowed broken tests to persist for months because is was someone else’s job. Everyone suffered, but nobody acted. Instead, there needs to be widespread recognition that a little work will pay back in a big way over the team.

Every team member needs to understand the needs of the customer. Large complex projects must be broken into separate teams and further divided for handing out to developers, but this should never be done to the extent that people lose sight of the desires and goals of the actual users of the final product.

Keep related definitions together. Structure the code so that highly related things are located together, possibly within one class. This is a standard OO design principle of encapsulation. Ideally, all the code outside the class will not need to know the details of the internal workings. Some developers delight in spreading details across multiple files in order to organize in different way: such as to keep all the same data types together, or to organize alphabetically. Fro example, putting all the constants in one class in a different package from where they are being used adds unnecessarily to the complexity of the program. The guiding rule should be to group by relatedness with the result being to hide complexity.
Always run the tests before checking in. This guideline will help you satisfy the “never break the build” guideline.
Premature optimization is the root of all evil. A quote from Don Knuth which rings true today. Code should be written well to avoid needless waste at the micro level, but optimization beyond the individual method level should wait until testing within the entire program with a stress test bases on an actual end user use case. Intuition of what is important for overall performance is almost always wrong when based only on a static understanding of the code. Instead, measure the behavior of the complete system, to identify the 1% of the code that really makes a different in performance, and focus on that.
Minimize backlog of uncompleted coding tasks. When a developer starts to work on a use case, there is a cost associated with all the code that has been modified, but not completed and tested. Holding uncompleted changes for days or weeks adds up to a significant risk of waste due to rework. Consider three tasks estimated to take 1 day each. Starting all three at one time, and working in parallel for three days involves an accumulation of 9 “units” of cost. But doing each task sequentially, completing each task before starting the next, involves only 3 “units” of cost. This is not intuitive. Our intuition tells us that while we are in there, we might as well do three things at once, before buttoning the work up. But software is not like physical construction. Short, quick, and complete jobs not only cause less cognitive load, but also reduce the chance that uncompleted work will conflict with another person’s uncompleted work.
Never overgeneralize functionality. This is also know as “YAGNI – You Aren’t Going to Need It” . While coding a particular class, programmers like to think with a small tweak this class might be used for several other purposes. This is fine if those purposes are required by the current use case, but usually the programmer is thinking about uses which have not been invented yet, and which may in fact never be needed. (This subject always reminds me of the classic Saturday Night Live skit about the product which was both a floor wax, and a dessert topping.)
Never use 3 lines when 2 lines would do. Succinctness in code pays every time someone else has to read it. But don’t shrink the code to the point of being difficult to read. Smaller, well written code can easier to maintain and easier to spot errors in, than verbose, ornately written code. Always simplify as much as possible, but no more.
Never ever measure code by counting lines. The number of lines needed to do a particular task varies greatly from programmer to programmer, and from style to style. The number of lines of code does not tell you much of anything about the completeness or the quality of the code. Code quality can vary by a factor of 200, and this overwhelms any usefulness of the count of the lines. Count instead functioning use cases.
Continually re-design and re-factor. Apply this cautiously because some code is brittle and difficult to change, but in general you should not be afraid to change the code to match the real use case. A data member may have been an integer in the past, but when a use case requires it to be a floating point don’t be afraid to change it.
Delete dead code. There is a tendency to let “sleeping dogs lie” when it comes to large blocks of code that is not well understood. One example is adding a new method to a class to replace another, quite often the developer will leave the old method there “just in case”. Some effort should be expended to check to see if that method is needed, and delete it if there is no evidence that it is needed. The worst offense is commenting out blocks of code, and leaving that commented code around. Commented code should be deleted as soon as you know that the tests run, and certainly before checking it in. It is easy to add code at any time, it is hard to delete code at any time. Therefor, at a particular time that you have a good idea that something might not be needed, and small extra effort to verify this and eliminate the code will make the codebase more maintainable.
Don’t invent new languages. Programmers love to make text files that drive functionality in way configurable at run-time. There are no end of configuration files to be able to change the behavior of the program without recompiling. The advent of XML is driving an unending chain of specialized custom “scripting languages” that allow functionality to be “programmed” by the end user without having to compile. The flaw in this reasoning is that the precise definition of the behavior of the operations almost never well defined outside of the context of a particular implementation, and these types of scripting languages are mainly useful only to people who have an intimate knowledge of the internal working of the code body in question. Thus, real end users without detailed internal knowledge can never possibly know what is necessary to anticipate the effect of complex combinations of commands. Scripting languages have a use, and can not be eliminated, but the designer must take a very very conservative approach and use existing languages as far as possible, and avoid inventing new ones.
Do not create a design until you are ready to implement and test the implementation. You should have some overall idea of where you are going, and a overview of the system architecture that will be aimed for, but no detailed design, no detailed description of functional implementation should be written down until the development iteration that will allow that design to be implemented and tests. The detailed design should cover only as much as is needed to handle the current use case. The biggest cause of waste in software development is time spend designing things that are not needed or need to be redesigned because of some mistaken assumptions that the design is based on.
Software is Plastic. Unlike physical manufacturing, software can be changed in significant ways very easily. In fact there is plenty of evidence that software is easier to change than the design specifications that describe the software. Furthermore, software communicates the design more effectively than the specification. Therefor, you should spend the time to implement the design directly, so that customers can see the details of the design. If you miss and have the change the design, it is easier to change the software than it would be to change the spec. But most important, your information about what the customers wants is far better after they have seen the code running.
Take the time to code a complete description of the problem in the code that detects and reports exceptional situations. Programmers are often very lazy and throw exceptions with superficial descriptions of what is wrong. Thinking that they are the only people who will ever see the problem, and they will remember the meaning of the problem from the vague description included. But in fact more time is wasted in customer support situations because of inaccurate or incomplete error reports than any other cause. Write every error message is if you are explaining the situation to someone who just walked into the room and has no experience with the code. The customer, and the customer support team, after all, have no experience with the code.

Agile Testing

Agile testing is a software testing practice that follows the statutes of the agile manifesto, treating software development as the customer of testing.Agile testing involves testing from the customer perspective as early as possible, testing early and often as code becomes available and stable enough from module/unit level testing.
Since working increments of the software is released very often in agile software development there is also a need to test often. This is often done by using automated acceptance testing to minimize the amount of manual labor. Doing only manual testing in agile development would likely result in either buggy software or slipping schedules because it would most often not be possible to test the whole software manually before every release.Agile software development is a conceptual framework for software engineering that promotes development iterations throughout the life-cycle of the project.There are many agile development methods; most minimize risk by developing software in short amounts of time. Software developed during one unit of time is referred to as an iteration, which may last from one to four weeks. Each iteration is an entire software project: including planning, requirements analysis, design, coding, testing, and documentation. An iteration may not add enough functionality to warrant releasing the product to market but the goal is to have an available release (without bugs) at the end of each iteration. At the end of each iteration, the team re-evaluates project priorities.Agile methods emphasize face-to-face communication over written documents. Most agile teams are located in a single open office sometimes referred to as a bullpen. At a minimum, this includes programmers and their "customers" (customers define the product; they may be product managers, business analysts, or the clients). The office may include testers, interaction designers, technical writers, and managers.Agile methods also emphasize working software as the primary measure of progress. Combined with the preference for face-to-face communication, agile methods produce very little written documentation relative to other methods. This has resulted in criticism of agile methods as being undisciplined.

Exploratory testing - creation or disorder motion of the ideas?

Table of Content
Introduction
All testers do this...
Study the new project
Choosing Approach
Choosing the Executors
3 stages of Exploratory Testing
Summarizing and evaluating: merits and demerits
Conclusion
Introduction
When you first meet the concept of the exploratory testing you can think that its name fully exposes the sense of this sort of activity. But if you get a little bit deeper – this confidence weakens and disappears. Especially clear it can be seen when balancing between the concepts of the exploratory and wild testing, which in one hand are synonyms in QA industry, and in another (from the good sense point of view) – contrary one to another. It’s because what can have in common the exploration – serious, responsible and well-organized process – and something wild and chaotic, that is wild testing?
And nevertheless I would say that these two types are much interconnected. It is possible even to say that the wild testing is a subset of the exploratory testing, as the last one is very powerful tool, which is used for any software product, as probably no other type of testing is. You can’t start working with any application without it. Even without realizing that, a tester makes first steps in working with a product according to the written and unwritten rules of the exploratory testing.
So what is exploratory testing, when and how it is utilized, what are its goals, approaches, benefits and penalties?
We’ll discuss everything that in this article.
All testers do this…
The exploratory testing is the only type of testing which does not have a certain scenario. There are no documented Test Plan and test cases. All of scenarios are born in the tester’s mind just in the process of testing and are executed at once. Here is the main difficulty of the process – you should have a considerable base of knowledge and experience.
The main purposes of the exploratory testing are study of the software product (if it’s the first time when tester works with it) and search for the cases untaken into account in the test documentation (if it’s not the first session of work). Watching the program, you hypothesize about its possible behavior, the variants of its responses to your actions and then check up these hypotheses.
And however you can’t do it without a plan. To make the testing more effective it is recommended to create the check-list which will guide you. It’s not obligatory to have it written down but it’s strongly recommended to bear it in mind.
The ideal variant of realization of the exploratory testing is drafting and passing user-cases or tests, which are maximally close to the actions usually performed by user.
If it is the first time when the program is tested, then putting yourself on the user’s place you can find out the most critical bugs for the application functioning. And even if it’s not the first time you work with an application it’s useful to think like a user. The more time tester spends with developers the more he adopts their way of thinking and move away from user. The situation is aggravated by the shortage of time for testing. The more systematic character has the execution of test sets and the less time team has for it the less fantasy is shown by the tester. It’s hard to meet the schedule when you find an «interesting» situation and start to experiment. As the result the vision of the project stiffens, associations become very specific and linked to the concrete steps and terms. It is difficult to find something new or do the same in other way with such adaptation.
So, performing the exploratory testing always try to think in the way a user thinks!
During the testing you should not limit yourself by some rational scopes or paradigms - in fact users very often perform very inefficient actions which can have some unpleasant results.
Try to analyze, what functionality is utilized more frequently and what is touched much rarer. This information will help you to distribute your attention among different features.
The important initial stage of the exploratory testing is formulating the goal. Ask yourself: «Why do I do it? For what purpose?» After completing the testing try to measure your success.
The list of the most widespread goals
Study of the new product;
Exposure of omissions in the test-plan. The result is to add non-standard tests to the test coverage;
Performing the testing of the project with incomplete or inexact specification or when the specification is absent;
Research of the specific defect;
Improvement of the product quality after completion of the basic (for example, functional) testing.
Study the new project
Mostly common the exploratory testing is used as the tool for the study of the new project or functionality.
In this situation you should try to learn all accessible information before starting the testing process.
Documentation is on the first place, as usual. If it’s present, of cause… Specifications, requirement specifications will always remain the faithful helpers of tester.
If consider the process of the exploratory testing as the building of a house, then the documentation is its reliable foundation.
The second step is to ask developers and project managers. They always possess necessary knowledge about the project, therefore do not ignore ANY useful information, ask them questions. My experience shows that this meeting can considerably change your priorities and add new test cases.
Choosing approach
The next stage in building of our house is to choose a project. How we will build? What materials will be used? Where will windows and doors be?
Returning to the QA industry terminology we should choose testing approach. There exist a lot of them, we will consider a few basic ones:
Basic functionality. It is especially important when we have tough time constraints. In this case we shouldn’t get into details and get stuck in some little things. First of all it is necessary to check up main functionality and make sure in its capacity for work.
Places where bugs appear the most frequently. Such places can be the new functionality or those parts of the program which are the most frequently rebuilt. Certainly, this approach is applicable only in case if it’s not the first time you work with the program, and already know its thin places.
The simplest use-cases (for the new build validation). If you’ve got the new version, or version after the deep refactoring then don’t be too lazy to check up the most ordinary use-case, and if it fails return this version to the developers with confidence.
Set of the “favorite” bugs. It will work if the tester knows the programmer well. Each developer has the set of the “favorite” bugs – and each software solution has. When there is much experience of testing even the exploratory testing can be performed by the algorithm.
Concentration on everything and on nothing concretely. This approach is slightly philosophical. Begin to work with the application as a user and concentrate your attention on everything and on nothing concretely. It’s just like you watch from the outside what is going on. Don’t try to analyze anything while working but be ready to start the analysis at any moment and reproduce all of the steps.
Vulnerability. Those who know the design and UML will get it easier. The schematic model of the project is created, and the weakest place is determined using different methods and approaches. Analysis can be performed from the position of user, architecture or realization. Unlike the usual test design here we analyze the specific model - mixture of architecture of business processes and human perception.
Choosing the executors
So we chose the project for our house J. Next question is about the workers. Who will be assigned to this responsible task?
The first are QA specialists. When choosing the responsible tester you should estimate his experience. It is not inconceivable that assigning an inexperienced man to perform the exploratory testing of the new product you will spend time for unavailing mouse clicking.
It is good to get not only QA specialists to take part in the exploratory testing but also other team members, for example developers. Frequently a tester thinks deeper than a user usually does and so sometimes he complicates a task while not seeing the most obvious errors. The exploratory testing will be good here with its fresh look to the situation.
After performing the regression testing of the product many companies invite independent experts who perform the exploratory testing, simulating the behavior of end users. Expenses on such testing usually justify themselves, as far as critical bugs will be found and fixed before the release.
3 stages of exploratory testing
Watch Out! Construction Work!
Many sources describe the process of the exploratory testing as the following cycle of actions:
study of the product -> planning of tests -> implementation of tests
And everything this, as already mentioned higher, is not fixed in documents but takes place only in the tester’s mind. It is another argument in behalf on that the exploratory testing should be performed by really experienced specialists: it is the only type of testing, which includes 3 stages of testing of software product simultaneously.
The following questions can help in the process of planning of tests:
And what will happen if ...?
And how the program will respond on such my actions?
What data can I get?
Summarizing we can say that the slogan of the exploratory testing is: «Imagine the problem, and then find it».
Summarizing and evaluating: merits and demerits
Walls are ready. Just one small thing is left to do– to construct the roof.
In this section we’ll sum up and, as a result, describe pluses and minuses of the exploratory testing.
Merits of the exploratory testing:
Exposes functionality, uncovered by tests;
Helps to find the skipped bugs;
Allows to look at the product from the end user point of view;
Helps to realize the mission of the tested product, improves understanding of it;
Requires little preliminary work as far as it’s not too formalized;
Helps to find out the majority of critical bugs almost at once;
It is acceptable in terms of lack of resources;
Discovers usability bugs.
Demerits of the exploratory testing:
It is impossible to estimate time for this testing, and, consequently, to set the terms of project completion;
It is hard to estimate the project if only exploratory testing is used - it is impossible to make statistics of passed and to failed tests, which is one of basic indexes of product quality.
There is no other possibility to check up results but just fully retest the project;
It’s impossible to review test cases;
The exploratory testing never can be performed identically for several times. Some tests will slip out each time, and so there is a risk to skip some bugs;
Results depend much on the experience of tester.
Conclusion
You can read music and you can improvise. Any skills suppose, foremost, that you master some basic techniques and also have certain framework to use as a ground of improvisation.
The same is true for the testing. The exploratory testing is improvisation, the highest degree of tester mastery. It is a complex creative process requiring significant efforts. To perform really qualitative exploratory testing tester should have a lot of experience.
Perform the exploratory testing for the first acquaintance with a product, and it will help to study and understand your application.
Execute the exploratory testing simultaneously with the regressive testing – you will promote the quality of your product, discovering the serious non-standard errors just on the testing stage.
Perform the exploratory testing after basic one and you will be able to discover and remove bugs that slipped out before.
And let your project be high-quality!

Six Commonly used Software Testing Techniques

Software Testing techniques include, but are not restricted to, the process of running a computer program or application with the aim of finding software defects. In this article we will discuss some of the basic and most commonly used test-techniques and quality assurance testing methods applicable to any software project:
Usability testing methods: In this method we test how easily the end users can learn and use the product. Understandably this is subjective, and will depend upon the targeted end-user or customer. User interviews, surveys, video recording of user sessions, and other techniques can be used to find and test the “userfriendliness” of the application. Coders and testers are commonly not suited as usability testers.
Integration testing techniques: Testing of combined modules of an application to determine if they function together correctly. Commonly performed after unit and functional test. This type of Software Testing is especially applicable to client/server and distributed systems.
Top Down Integration: An approach to integration testing where the component at the top of the component hierarchy is tested first, with lower level components being simulated by stubs. Tested components are then applied to test lower level components. The process is repeated until the most down level components have been tested.
Bottom Up Integration: An approach to integration testing where the lowestlevel components are tested first, then used to facilitate the testing of higher level components. The process is repeated till the component part at the top in the hierarchy is tested.
Exploratory testing techniques: frequently accepted to mean a creative, informal software test which is not established on formal test plans or test cases; testers might be learning the software as they test it. Exploratory testing is not a new testing technique - as a matter of fact, many test engineers consciously or unconsciously apply of this technology. So, what is exploratory test?In general, exploratory testing has the following number of characteristics:1. Exploratory test emphasis on the test cases design and testing the code at the"same time" as opposed to the traditional software testing process which strictly follows "first design, followed by implementation and testing”.2. Test engineers will continuously learn the system under test by doing the testing. 3. The focus of exploratory testing is to create new test cases continuously asexploring the system.
Agile Testing Methods: Test Plan -> Test Design -> Test Execution -> Test Analyses and Report, this process perhaps the most common process in any STLC. But here the test process in any agile project is little bit different. We split up the project into several iterations, and each phase will have its own plan, design, execution and report. So actually, every the test documents should be maintained in the whole project.
Regression Testing Techniques: It is nothing but retesting a previously tested program following modification to ensure that faults have not been introduced or uncovered as a result of the changes made. Basic methods of regression testing include re-running previously run tests and validating whether previously fixed defects have reappeared. Experience has shown that as software package is developed, this kind of reemergence of faults is most common. Some of the times it occurs because a fix gets lost through poor version control practices (or simple human error in revision control), but in a great deal a fix for a problem will be "fragile" in that it fixes the problem in the narrow case where it was first observed but not in more general cases which may arise over the lifetime of the software. Finally, it's often been the case that when some feature is redesigned, the same faults will be made in the redesign that were made in the original implementation of the feature. Hence, in most Software development situations it is considered good practice that when a defect is located and fixed, a Test that exposes the defect is recorded and on a regular basis retested after future changes to the Program. Though this may be exercised through Manual testing procedures using programming techniques, it is frequently done using automated testing tools. Such a test suite contains software tools that allow the testing environment to execute all the regression test cases automatically; a few projects even frame-up automated systems to automatically re run all regression tests at defined intervals and report any regressions errors. More common strategies are to run such a system after every successful compile (for small projects), every night, or once a week.
Sate transition software testing techniques: A form of black box testing design techniques, the design of test cases to execute valid and invalid state transitions.