Sie sind auf Seite 1von 3

Find the bugs in the two endpoints described below

Problem 1 - Reverse Words

The endpoint at http://findthebug.herokuapp.com/reversewords takes in a


sentence as input, and reverses the words in the sentence.

For example, "the quick brown fox" will return "eht kciuq nworb xof".
The endpoint allows GET and POST requests, and accepts a single parameter
'string', which should contain the input sentence.

Example usage is given below:


http://findthebug.herokuapp.com/reversewords?string=the quick brown fox
curl -X POST findthebug.herokuapp.com/reversewords -d 'string=the quick
brown fox'

Test this endpoint for possible bugs.

Updated by: Subha Moorthi Date : 22 Apr 2016

Bug lists

1. URL length greater than 2048 characters


(GET Rule is maximum URL length is 2048 characters)

If the input string contains more than 2048 characters, then Get method will throw error.

2. Enter NON ASCII characters

GET will accept only ASCII characters

If the input string contains non ASCII characters, then Get method will throw error.

3. Do not pass any string value (passing NULL)

If the input string contains NULL, verify the result

4. Pass float value as Input sting

Input Sting: 1890.00

If the input string contains float values, verify the result

5. Verification truncation of input value

Input sting as “ the quick brown fox”

If the input string contains float values, verify the result


Problem 2 - Prime Numbers

The endpoint at http://findthebug.herokuapp.com/primenumbers returns 'true'


if the given input is a prime number and 'false' otherwise.

The endpoint allows GET and POST requests, and accepts a single parameter
'number', which should be an integer between 1 and 1000.

Example usage is given below:


http://findthebug.herokuapp.com/primenumbers?number=100
curl -X POST findthebug.herokuapp.com/primenumbers -d 'number=100'

The list of prime numbers between 1 and 1000 are given below:

[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67,
71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149,
151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313,
317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409,
419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499,
503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601,
607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691,
701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809,
811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907,
911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]

Write an automated test for detecting if the endpoint correctly detects


prime numbers between 1 and 1000.

Positive Test Scenario:


Test data follow check: 1
1. Enter the Number
2. Verify is it prime or not prime
3. If it is true, check the range between (1-1000)
4. If the number falls under above range, it is prime number, then prime number validation
functionality implementation is correct
Test data follow check: 2
1. Enter the Number
2. Verify is it prime or not prime
3. If it is true, check the range between (1-1000)
4. If the number doesn’t fall under above range, it is not a prime number, then prime
number validation functionality implementation is wrong
Test data follow check: 3
1. Enter the Number
2. Verify is it prime or not prime
3. If it is false, check the range between (1-1000)
4. If the number falls under above range, it is prime number, but prime number validation
implementation functionality is wrong
Test data follow check: 4
1. Enter the Number
2. Verify is it prime or not prime
3. If it is false, check the range between (1-1000)
4. If the number doesn’t falls under above range, it is not prime number, prime number
validation functionality implementation is correct
Negative Scenarios
1. Enter Number Zero or less than 0
2. Enter Number greater than 1000
3. Enter String value

Das könnte Ihnen auch gefallen