English 中文(简体)
Is this scenario considered functional-testing, or some other form of testing?
原标题:

I m writing tests that check that an external service is providing inventory data (on their test server) that I can check out with, and also cancel. This testing is in the travel/hotel world, and I need to place test reservations, then cancel them.

I take the following steps : 1) search for inventory(a hotel room) 90 days in the future 2) get the first result, and do a test checkout with it 3) cancel the order and confirm I get a cancellation number 4) confirm the appropriate database entries are performed

This testing touches wide ranging parts of the system, and I don t (currently) have mechanisms to isolate each of them. I therefore don t consider this unit testing. However, would this be called functional testing, or something else?

As a follow up, it will probably help to isolate and write tests for each of the subsystems I m interacting with. Where would you guys start in the isolation process?

最佳回答

Each of those steps you listed is a good candidate for an isolation:

  1. Get inventory
  2. Check out
  3. Cancel
  4. Get cancellation #

Stringing them together as you do now is only a function of each of them working individually anyhow.

You re currently testing for functionality (good!) but you didn t mention robustness.

I would make a suite of data for each function (as I have listed) that would try to break it and probe corner cases. Try to book in the past, try to over-write POST data, try to over book a room, try to simultaneously book the same room twice, etc. This is all stored as input parameters in a test you have written just for one isolate of your application.

The different isolates will have different data that is useful/meaningful to test with, but with each change/commit/build, you should be able to run the test data against each function and have the results be valid (IE you return a query, check out a room, cancel the reservation, or get the cancellation #)

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签