From the blog Table of Code by Andon S and used with permission of the author. All other rights reserved by the author.
Category Archives: Software Testing
V-Model Testing (WEEK 12)
From the blog Table of Code by Andon S and used with permission of the author. All other rights reserved by the author.
V-Model Testing (WEEK 12)
From the blog Table of Code by Andon S and used with permission of the author. All other rights reserved by the author.
V-Model Testing (WEEK 12)
From the blog Table of Code by Andon S and used with permission of the author. All other rights reserved by the author.
V-Model Testing (WEEK 12)
From the blog Table of Code by Andon S and used with permission of the author. All other rights reserved by the author.
V-Model Testing (WEEK 12)
From the blog Table of Code by Andon S and used with permission of the author. All other rights reserved by the author.
Pass by object reference
Python’s passes parameters by object reference. What does that mean? Let’s first explore the pass-by-reference and pass-by-value parameter passing paradigms.
Pass-by-reference:
In pass-by-reference, the variable is passed directly into the function.
The new variable points to the same object as the old variable. We just created a new reference to point to the same object.
Pass-by-value:
In pass-by-value, the function receives a copy of the argument objects passed to it and is stored in a new location in memory.
The new variable points to a different object (a copy of the old object).
Pass-by-object-reference:
Python is different than languages like Java(pass-by-value) in that it supports both pass-by-value and pass-by-reference. Variable in Python are not like the variable we know from other programming languages: variables in Python are object references. The value stored in a python variable is the memory address of the value, not the actual value. It is the memory address that is passed into a function, not the actual value. This means Python’s functions support call by object-reference semantics.
Based on the type of the object referred to, the actual call semantics used will differ. If the variable refers to a mutable value, call-by-reference is used. If variable refers to a immutable value, call-by-value is used.
References:
- http://robertheaton.com/2014/02/09/pythons-pass-by-object-reference-as-explained-by-philip-k-dick/
- Head First Python, 2nd Edition by Paul Barry
From the blog Software Testing – The blog about software by Sudarshan and used with permission of the author. All other rights reserved by the author.
5 Common Mistakes in Automated Testing
In his article, Rohit Sharma goes over the top five most common mistakes users have made when using automation tools for testing.
The first item on his list is when testers “think of automation testing as little more than record and replay.” He goes on to say that proper automation testing is done when a tester has customized the generated script for their specific needs. Sharma also mentions that the record feature should only be seen as an outline and not as the finished script.
Second on the list is when testers do not validate the scripts that they are using. Sharma suggests that using checkpoints, at as many places as possible, can help to remedy this situation.
The third thing is that you don’t want to just validate your visible components when testing. Anything that happens on the back end should also be checked to make sure that your script is properly validating it (the two examples that Sharma gives are communications to a database, and making sure a file was automatically created properly).
Fourth on the list is making sure to remember that automated testing cannot replace human testing. Sharma states that “automation is a great way to augment your testing efforts,” but automation testing only works well “when you know what to look for.” In the case that he states, you could have a web page that generates unreadable text, but, unless you have someone looking out for that, you are unlikely to find it with automation testing.
The last item that Sharma talks about is making creating “inappropriate test cases.” He points out that there are multitudes of paths that a user can use in your application so trying to test all of them would waste time. Instead, try to figure out how to “condense all possible paths to a small sample of highly representative test cases,” so that it covers the majority of your user’s activity.
From the blog CS WSU – Techni-Cat by clamberthutchinson and used with permission of the author. All other rights reserved by the author.
Mutation Testing
Mutation Testing
It is one thing to use the many techniques to come up with a set of test. There is software that will go through you code and test cases and provides a measure which show how much of your code is actually covered by the tests. This is a great start but how do you know if your tests are really helpful. That is to say are do the test do a good job at testing the code and would they pick up on errors. To really judge how strong your test suite is you need to be able to test your test. One way of doing this is by purposely making changes to your code and seeing if your tests catch it. This is called mutation testing.
Manually going through your code would be very time consuming and tedious. The benefits would not be worth the effort. Luckily there are programs that automate this process. I personally looked at Pit Mutation Testing. It can be found at pitest.org. In the case of Pitest it works with Java and the software directly modifies the byte code which makes the process much faster as you don’t need to edit the source then recompile.
The code systematically works through the code and makes changes, these changes are referred to as mutants. It then runs the tests to see if these mutants survive or are killed. It then generates a report that shows what lines are covered by the test as well as what mutations it generated. For each mutation it will show if it survived or was killed. In the case of a surviving mutation it will indicate whether it was tested and survived or if it was simply never tested.
Some of the mutation it tries include changing logical operators, changing the the operations in equations and returning null.
these changes include changes logical statements.
From the blog CS@WSU – :(){ :|: & };: by rmurphy12blog and used with permission of the author. All other rights reserved by the author.
7 Best Practices for Agile Test Driven Development
This article goes over seven different practices that will help with Test Driven Development when using the Agile approach.
The first thing that should be done is make sure you “avoid functional complexity.” The point of this type of approach is to keep it simple. The article suggests going over with your team to make sure that the test covers all the functionality that is needed.
The second thing is to make sure you have a clear understanding on what it is you are trying to achieve. It’s advised that you follow standard documentation and naming for your tests. This is so that developers are able to come back to it and understand what was the intended purpose for the set of tests.
The third item is that code is not overly complected. You want to make sure that your test is kept simple so that the code is easily readable and has room for any necessary improvements.
Fourth on the list is to make sure you are testing everything repeatedly. Always run tests before and after coding, and after refactoring since you never know when adding something new might break your tests. Also remember that when you refactor, to make sure that the node is still “maintainable and adheres to standards.”
Fifth point that is made is to “maintain code sanctity.” This means that you should be using version control tools to keep your code in check; which is extremely import if you have multiple developers working on the same code.
The sixth thing is making sure that your team is aware and understands how the application works. To do this make sure that the system documentation is clear and that all team members understand how the system and tests work. This will not only make sure that when new code is added, the overall program will not break, but also that new tests will work in the first run.
The last item that the article points out is to “know when to use TDD.” Test Driven Development is not suppose to be used for any testing that will take a long time. Always remember TDD primary function is to be used for projects that can be tested quickly.
From the blog CS WSU – Techni-Cat by clamberthutchinson and used with permission of the author. All other rights reserved by the author.