Ask Computer Engineering Expert

Assignment: Software testing and TDD

The big picture: We're developing an inventory and purchasing system for a regional franchise, our client. The complete software system will include an inventory management system and will control the point-of-sale checkout registers. Our team is responsible for the point-of-sale software, not the inventory system. Because of the financial, tax, and legal liability of the client, the software accuracy must be ensured and verified.

User Story: Compute the net price of all the items in a customer's shopping cart including all applicable discounts and taxes.

After discussing further with the client, we have defined the following functional requirements.

FR 1) If the shopping cart contains 10 or more items, the customers shall get a 10% discount off of the purchase price before taxes are included. Otherwise, if the shopping cart contains more than 5 items, the customer shall receive a 5% discount before tax. The customer receives no discount if less than 5 items.

FR 2) If the customer is a member of the store's discount shopping club, they shall receive an additional 10% discount off of the purchase price before taxes.

FR 3) Customers shall not purchase more than 50 items in a single checkout session.

FR 4) Unless a customer has tax-exempt status, the local sales tax rate of 4.5% shall be applied to the net discounted price.

FR 5) Dollar amounts shall be rounded to the nearest cent ($0.01) before and after the tax rate is applied.

FR 6) The net purchase before any discount, the net discount, the tax amount, and the net total due shall all be reported in dollars.

Task 1:

Analyze the 1st four functional requirements above (FR 1-4) and determine the number of test cases needed to provide 100% path coverage. Use graph theory (i.e., control flow analysis) and / or truth tables to analyze the required logic. Furthermore, design additional tests using equivalence partitions and boundary value analysis (BVA) to provide further verification.

Submit your analysis of the theoretical number of test cases to Sakai. Describe how your deduced the number of test cases and provide documentation (e.g., flow graphs, pseudo-code, truth tables).

Task 2:

Implement the above user story using an object-oriented (OO) language of your choosing. Implement the functionality incrementally using the test-drive development (TDD) principle. Create automated tests cases that provide statement, branch, conditional, and loop coverage as necessary. Create additional test cases using equivalence partitioning (EP) and boundary value analysis (BVA) techniques as needed. Note, that you have already designed the tests in task 1 but verify that you still have sufficient coverage.

Keep a developer's log documenting the increments coded, the associated test(s), what bugs were found by which test case, and why. Describe the intent and motivation for each test. Create mock objects as needed to complete the implementation and testing. Publish code on BitBucket with sufficient commit history to track the evolution of the TDD process.

Development details:

The larger inventory database system is not complete but the software design of the database defines a

DataBase class that has a getItem member function:
Item DataBase::getItem (String ItemID)
that returns a pointer to an object of type Item if found; otherwise, it returns NULL. The Item class has a getPrice member function:
float Item::getPrice()
that returns the purchase price of a single item. Implement the method
ShoppingCast::calcPurchasePrice (String[] ProductIDs, Customer customer)
which is a member of the ShoppingCart class. ProductIDs is a list (i.e., array) of strings (in your favorite OO language) that represent the item ID's of the products in the customer's shopping cart (assume they were scanned already) and Customer is a class with methods indicating if the customer is a member of the store's Discount Shoppers Club and if they are tax-exempt. I leave it to you (and your partner if you choose) to design of the Customer class and the list of strings parameters passed to the calcPurchasePrice method.

You will need to create a mock database object of type DataBase to supply information to the ShoppingCart class method(s). The mock object can be instantiated and passed to the constructor of your ShoppingCart to avoid inheritance issues when the real data type is included.

Commit your OO source code and automated test cases to BitBucket and developer's log to Sakai. The submitted code must be professional quality. Include sufficient interface documentation to allow an outside developer or tester to create and execute black-box test cases based upon the specified user requirements. Include instructions for building your source and linking with a driver application. Your code should separate the class signatures from the implementations as much as possible within the confines of your chosen programming language. For example, separate class headers (.h, .hpp) and implementation files (.cpp) in C++.

Advice: It is good practice to avoid publishing source or build methods that are dependent upon a specific IDE. Ideally, your code should be structured so that it can be built without an IDE; however, this is not a requirement for this assignment. Why is this an issue? When publishing (or delivering) executable software systems, the build environment is not particularly relevant. However, when publishing source code, the intent is that other developers can build your suite. Tight dependency upon a specific IDE can be a burden and anything that is burdensome reduces uptake.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92703502

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As