Posts

Refactoring - Inline Temp

Motivation:  You have a temp that is assigned to once with a simple expression, and the temp is getting in the way of other refactorings. float dvdPrice = MovieDVD.Price(); return dvdPrice; Refactor as: return MovieDVD.Price();

Refactoring - Inline Method

Motivation:  A method's body is just as clear as its name. public float GetMovieRanking(float rating, int totalVotes, int minVotesRequired, float meanVotes) { return CalculateMovieRanking(rating, totalVotes, minVotesRequired, meanVotes); } private static float CalculateMovieRanking(float rating, int totalVotes, int minVotesRequired, float meanVotes) { float movieRanking = (rating * totalVotes + minVotesRequired * meanVotes) / (totalVotes + minVotesRequired); return movieRanking; } Refactor as: public float GetMovieRanking(float rating, int totalVotes, int minVotesRequired, float meanVotes) { float movieRanking = (rating * totalVotes + minVotesRequired * meanVotes) / (totalVotes + minVotesRequired); return movieRanking; }

Refactoring - Extract Method

Motivation:  Producing methods that efficiently communicate what they do and how they do what they do. It consists of calls to well-named methods that are all at the same level of detail. public float CalculateMovieRanking(float rating, int totalVotes, int minVotesRequired, float meanVotes) { if (rating > 10 && rating < 0) throw new Exception("The rating should be in range of 0 and 10"); if (minVotesRequired < 3000) throw new Exception("Minimum votes required for the calculation is 3000"); if (totalVotes < minVotesRequired) throw new Exception("The total votes can not be less than minimum votes required"); if (meanVotes > 10 && meanVotes < 0) throw new Exception("The mean votes should be in range of 0 and 10"); float movieRanking = (rating*totalVotes + minVotesRequired*meanVotes) / (totalVotes + minVotesRequired); return movieRanking; } Ref

My Bookmarks

My Bookmarks Test Automation Tool Independent Automation Framework Manual Testing Combinatorial Testing Unit Testing Reference on Design Patterns, Antipatterns, UML, Refactoring Agile Testing Explanation on Product Backlog and Items Test Metrics Dashboards (Agile) Implementing Automated Software Testing - Continuously Track Progress and Adjust Accordingly BI / DW Testing BI Testing Process DW Testing Strategies for Testing Data Warehouse Applications Performance Analysis Performance Troubleshooting using the PAL tool Get a Handle on Windows Performance Analysis Performance Analysis of Logs Performance Testing Tools PAL Tool Relog - filter the perf logs Empirix Hammer - IVR kind of application Test Automation Tools Open Source MBT Tool Choosing Test Automation Framework Testing Forums Software Testing Club

Refactoring - Chain Constructors

Motivation:  Chain the constructors together to minimize the duplicate code without having to resort to initialization method.  Initialization method is troublesome because only constructor can modify read only members. public class Movie { private readonly string title; private readonly string genre; private readonly string director; public Movie(string title, string genre) { this.title = title; this.genre = genre; } public Movie(string title, string genre, string director) { this.title = title; this.genre = genre; this.director = director; } } Refactor as: public class Movie { private readonly string title; private readonly string genre; private readonly string director; public Movie(string title, string genre) { this.title = title; this.genre = genre; } public Movie2(string title, string genre, string director):this(title, genre) {

Typical System Level Testing Tasks

Analyze products’ features and functions based on the risk of their failure – a function of importance, likelihood and impact of failures.  The risks can be associated with business, operational, technology or external. Development of testing strategy, which includes selection of relevant testing techniques and prioritizing of testing activities. Preparation of test plan Designing tests by selecting key test ideas Setting up the test environment if not available here Execution of test cases Reporting of defects Reporting of test execution results to stakeholders Preparation of the traceability matrix Management of test artifacts and testware environment Designing and development of regression tests

Process for Identification of Key Business Scenarios for Performance Testing

1.       Introduction 2.       Criteria 2.1.        Contractually Obligated Business Scenarios 2.2.        Frequently Used Scenarios 2.3.        Business Critical Business Scenarios 2.4.        Performance Intensive Business Scenarios 2.5.        Technologies Concerning Business Scenarios 2.6.        Stakeholders Concerning Business Scenarios 2.7.        Time Dependent Frequently Used Scenarios 3.       Approach 3.1.        Identification of All Scenarios 3.2.        Identification of All Activities of a Scenario 3.3.        Scenarios vs. Identification Criteria 3.4.        Listing of Key Business Scenarios 3.5.        Sharing of Key Business Scenarios to All Stakeholders 3.6.        Finalize 4.       Conclusion Introduction Identification of key business scenarios is one of the important activities during the performance testing.  The activity takes place during the “Discover” phase. It plays a vital role as the performance