<<

IJCSI International Journal of Issues, Volume 12, Issue 2, March 2015 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org 327

Generating Test Cases for E-Commerce Systems

Khalid Alzubi Albalqa Applied University, Salt, Jordan

Abstract testing is any activity aimed at evaluating a capability of a program or system to determine that it meets its required results and detect defects. In this paper main testing techniques are shortly described and their classification is outlined. It focuses on Purpose Software Testing Techniques and examines different examples for each and every testing technique. Keywords: Software Testing, Correctness Testing, Performance Testing, Reliability Testing, 1. Introduction confirms that either the software is working according to the requirement Software Testing is the process of specifications or not. Software testing executing a program or system for finding includes a number of steps which is any error or defect. Software Testing designed to make sure that computer code Strategy helps to convert designs does what it was designed to do [10]. into well- planned execution steps that will result in the construction of successful There is a dire need for Software testing software. The primary goal of test cases is for if we fail to deliver a reliable, good to derive set of tests that have the highest and error free software solution, our of uncovering the errors. project fails and we may lose clients. Thus, in order to guarantee proper software Software testing is a destructive process solution, we go for testing. We test for any of trying to find the errors. The main problem or error in the system, which can purpose of testing is , make software unusable by the client. We reliability estimation, validation or make software testers test the system and verification. help in finding out the bugs in the system Despite its limitations, testing is an to fix them on time [2]. Software testing is important part in . It a process of measuring the quality of the is broadly deployed in every phase in the developed software. It is also a process of software development cycle. Typically, uncovering bugs in a program and makes it more than 50% percent of the development active. It is a useful process for executing time is spent in testing [9]. the program. In order to ensure the , one 2. TESTING conducts software testing in every phase of Software testing is an activity used for the software development process. A finding errors in software. It also verifies complete software testing should cover the and validates whether the program is entire life cycle of software product. [1] working correctly and smoothly with no bugs. It analyzes the software system to find such bugs. Also Software testing

2015 International Journal of Computer Science Issues IJCSI International Journal of Computer Science Issues, Volume 12, Issue 2, March 2015 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org 328

2.1 Software Testing Objectives: different life cycle phases; they are Main goals of testing can be quality classified into four groups. assurance, reliability estimation, validation By purpose Classification, software testing or verification. Testing includes other can be divided into correctness testing objectives: (White-box testing, Black-box testing,  Testing is the process of executing a Gray-box testing), performance testing, program to find errors. reliability testing and security test.  A good test case is one for finding an By life-cycle phase Classification, undiscovered error with a high probability. software testing can be classified into the  A successful test is one that discovers an following categories: requirements phase undiscovered error. testing, design phase testing, program  The software that works better can be phase testing, evaluating test results, tested more efficiently. installation phase testing, acceptance  Testing is the process that identifies the testing and maintenance testing. correctness and completeness of the By scope Classification, software testing software. can be categorized as follows: , component testing, , and 2.2 . The test can be good and efficient By Fault Based Methods Classification, depending on the software itself, and here which include Error Based Testing, Fault a checklist for the software testability is seeding, , and fault needed injection, among others.  Operability – when it works better, it can be tested more efficiently. 4. Test cases  Observability - what you test is what you 4.1 Test case definition see. IEEE Standard 610 (1990) defines test  Controllability – controlling the software case as follows: better makes testing more automated and “(1) a set of test inputs, execution optimized. conditions, and expected results developed  Decomposability - problems can be for a particular objective, such as to isolated and retested intelligently more exercise a particular program path or to quickly by controlling the scope of testing. verify compliance with a specific  Simplicity - we can test quickly if the requirement. test is less complex. “(2) (IEEE Std 829-1983) Documentation  Stability – with few changes, specifying inputs, predicted results, and a disrupting testing is minimized. set of execution conditions for a test item.”[1]  Understandability - the more Then a test case is a question is put to the information known, the smarter the testing. program. The test goal is to gain 3. Software testing classification information as to whether the program will pass or fail the test. Testing methods and testing techniques are When running tests and test cases, try to in different and serve multiple purposes achieve some points:

2015 International Journal of Computer Science Issues IJCSI International Journal of Computer Science Issues, Volume 12, Issue 2, March 2015 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org 329

 Find bugs and report. Given the complexity of current and  Fix these bugs. expected software and communications systems, it is expected that software testing 4.2 Writing a good test case will become even more complicated. Then, Test cases can be “good” in different ways. even more strong tools and methodologies There’s no simple style or prescription for will emerge over time. is writing “good” test cases. becoming a less viable alternative, and According to the architecture of the system, integration with the overall design 90% of the system complexity is in the processes and tools will prove necessary to module analyzing. In this case, it is clear keep pace in testing these complex current that the test-case selection and test method and future systems. should be different. Testing may not cover some of the 5. Purpose Software Testing important sides of the application or system, Techniques for instance, by selecting only the expected The most prevalent techniques of software interactions when testing an application or testing are classified by purpose. Fig. 1 testing only some subset of the specified Represent software testing techniques functions. In most cases, it is more which are classified by purpose important to focus on determining the technical correctness of a system. It is needed to prioritize all requirements and the functions that are likely to contain critical problems. Most existing applications are too complex to test in every possible way, through all possible paths and states. Prioritizing the paths and scenarios that are tested first is useful, timesaving lesson for a test team, especially when resources are limited. Testing activities can fail in many ways; however, most problems can be prevented with the following practices: • form a suitable test team with the appropriate means for performing the tests at hand. • make testing an integral part of software Fig.1 software testing techniques [5] development. • employ management changing processes. a. Correctness Testing • ensure requirement traceability to and Correctness is the minimum requirement from tests. of software, the essential purpose of • automate test specification and testing. Correctness testing will need some execution. type of oracle, to tell the right behavior • Testability design. from the wrong one. The tester may or

2015 International Journal of Computer Science Issues IJCSI International Journal of Computer Science Issues, Volume 12, Issue 2, March 2015 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org 330

may not know the inside details of the b. Performance Testing software module under test, e.g. , data flow, etc. Therefore, either a Not all software systems have white-box point of view or black-box point specifications on performance explicitly. of view can be taken in testing software. But every system will have implicit We must note that the black-box and performance requirements. The software white-box ideas are not limited in should not take infinite time or infinite correctness testing only [9]. resource to execute. "Performance bugs" are sometimes used to refer to those design Correctness Test case example problems in software that cause the system Testing for an input box accept numbers performance to degrade. from 1 to 1000 then there is no use in Performance has always been a great writing thousand test cases for all 1000 concern and a driving force of computer valid input numbers plus other test cases evolution. Performance evaluation of a for invalid data. software system usually includes: resource Using equivalence partitioning method, usage, throughput, and response time and test cases can be divided into three sets of queue lengths detailing the average or input data called as classes. Each test case maximum number of tasks waiting to be is a representative of respective class. serviced by selected resources. Typical resources that need to be considered include network bandwidth requirements, So test cases were divided into three CPU cycles, disk space, disk access equivalence classes of some valid and operations, and memory usage. The goal invalid inputs. of performance testing can be performance 1) One input data class with all valid bottleneck identification, performance inputs. Pick a single value from range 1 to comparison and evaluation, etc [9]. 1000 as a valid test case. If you select Test case generation requirements: other values between 1 and 1000 then  Performance test cases should result is going to be the same. So, one test cover the most used scenarios of end- case for valid input data should be users’ behavior in the system (website, sufficient. application) to emulate load.  Include to test cases steps with 2) Input data class with all values below user actions which performance you lower limit. I.e. any value below 1, as an want to measure. invalid input data test case.  Separate performance test cases 3) Input data with any value greater than by logical parts of the system which 1000 to represent third invalid input class. you are going to test. So using equivalence partitioning means  Number of performance test that you have categorized all possible test cases should be as small as possible, cases into three classes. Test cases with but enough to cover important points other values from any class should give (typical number is 5-15). you the same result [14].  Number of steps in performance test case should be as small as possible, but

2015 International Journal of Computer Science Issues IJCSI International Journal of Computer Science Issues, Volume 12, Issue 2, March 2015 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org 331

enough to repeat usual user steps Fig.2 Performance example [15]. (typical number is 3-10). Reliability Testing  If system has some caching rules on . the server side test case should be written in a way that allows avoiding ‘Reliability Testing’ is very important, as it pinpoints all the failures of a influence of caching mechanism on system and removes them before the performance testing results. system is deployed. Reliability testing  Test case may describe real user's is related to many aspects of software behavior [16]. in which testing process is included; this testing process is an effective sampling method to measure software Test case example reliability. Estimation model is prepared in reliability testing which is Writing a test case for performance testing used to analyze the data to estimate the is basically writing a simple Requirement present and predict future reliability of software [5]. Specification for a piece of software .Just Based on reliability information, the as with any specification, it should be risk of using software can also be unambiguous and as complete as possible. evaluated.

d. Security Testing Security Testing makes sure that only the authorized person can access the program and only the authorized personnel can access the functions available to their security level. Security testing is very helpful for the tester for finding and fixing problems. It ensures that the system will run for a long time without any major problem. It also ensures that the systems used by any organization are secured against any unauthorized attack [10]. With the development of the Internet, software security problems are becoming even more serious. Many critical software applications have integrated security measures against malicious attacks. Simulated security attacks can be performed to find weakness points.

Test case example

Before beginning to write a test case: 1) It is important to segregate based on Roles (something like Admin, Manager,

2015 International Journal of Computer Science Issues IJCSI International Journal of Computer Science Issues, Volume 12, Issue 2, March 2015 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org 332

and Supervisor etc.) – 2) Delve into the negative for a Projects – Tasks particular event initially before taking up – the positive scenarios. This will ensure Dashboa continuity of the test cases and will greatly rd – help [13]. The table below shows an Reports example for security testing. – Skills Verify the The 4 menu “Projects dropdown ” menu N0 Action Test Pas for the should . steps s “Projects” contain /fai menu. the l following menu items. 1 Invoke the The – Create application by browser Task typing the URL should – Create “http://....; be Build invoked – Create and the Module applicati on login Like this you will need to page cover the other menus too. should appear. End of verification for the Project Lead. Verify the login security for the Project Lead.

Table1 security example[13]. Login with The user 2 login name should as be 6. CONCLUSION “abhilash” logged in Software testing is an important technique and and be password directed for the improvement and measurement of a as to the software system quality. “password5 Home In this paper we proposed that Software 6″. page. testing can be very costly. A good way to cut down time and cost is to generate good test cases. Verify the menu The A few cases and examples are considered 3 structure on the home Home page. page in this study and they are only used to should provide a clear explanation regarding contain testing techniques. the following menu REFERENCES structure [1] Cem Kaner, J. D. (2003). What Is a Good . Test Case? Proceedings of Florida Institute of

2015 International Journal of Computer Science Issues IJCSI International Journal of Computer Science Issues, Volume 12, Issue 2, March 2015 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org 333

Technology Department of Computer [9] Pan, J. (1999). Software testing. Retrieved Sciences STAR East. September, 2, 2013.

[2] Gandhi, G., & Garg, S. Implementing [10] Pardeshi, S. N. Study of Testing Software Testing Model Approach for Efficient Strategies and availableTools. International Bug Finding with Yin-Yang Testing Theory on Journal of Scientific and Research Java Application. Publications, ISSN, 2250-3153.

[3] Jovanovic, I. (2008). Software testing [11] Thakare, S., Chavan, S., & Chawan, P. methods and techniques. IM Jovanovic is with M. Software Testing Strategies and the Inzenjering, Mat, 26. Techniques..

[4] Khan, M. E. (2011). Different Approaches [12] Williams, L. (2004). Testing overview to White Box Testing Technique for Finding and black-box testing techniques. Alamat Errors. International Journal of Software situs: http://www. agile. csc. ncsu. edu/ Engineering and Its Applications, 5(3). SEMaterials/BlackBox. Pdf.

[5] Khan, M. E. (2010). Different forms of [13]https://eccentricabhi.wordpress.com/2009/ software testing techniques for finding 07/15/writing-test-cases-for-security-test-role- errors. International Journal of Computer based/ [26/12/2014] Science Issues, May, 7(3), 11-16. [14] http://www.softwaretestinghelp.com/what- [6] Luo, L. (2001). Software testing is-boundary-value-analysis-and-equivalence- techniques. Institute for software research partitioning/ [26/12/2014] international Carnegie mellon university Pittsburgh, PA, 15232(1-19), 19 [15] http://www.myloadtest.com/how-to-write- a-performance-test-case/ [26/12/2014] [7] Nidhra, S., & Dondeti, J. (2012). BLACK BOX AND WHITE BOX TESTING [16] TECHNIQUES–ALiterature http://loadtestcrew.com/2013/02/performance- REVIEW. International Journal of Embedded test-cases/ [26/12/2014] Systems and Applications (IJESA), 2(2), 29- 50.

[8] Nirpal, P. B., & Kale, K. V. (2011). A Brief Overview Of Software Testing Metrics. International Journal on Computer Science and Engineering (IJCSE),3(1).

2015 International Journal of Computer Science Issues