Problem 44631. Make your own Test Suite (part 0)

Have no knowledge of "floating-point numbers"? Read the documentation, and/or try Problem 44690 first.


In this task you need to imagine that you — yes, YOU — have developed a problem on Cody for me to solve, and now you need to draft a naïve Test Suite as the first step in developing a more robust Test Suite that would check whether my submitted solutions meet your requirements or not.

So the tables are turned! You are now in the role of Tester! I am in the role of Player!

The problem you've set me is to:

  • output the sine of an angle, when the angle is specified in degrees as a (scalar) double, with no restriction in the domain.

You provide me with the following example for the function defined as s = SINE(a):

 a = 45 % degrees
 s = 1/sqrt(2)

Now I have responded by submitting a large number of purported 'solutions', some of which are reasonably accurate, and others which are either too imprecise or else logically flawed.

Your final Test Suite (contained within your function testSuite) will have to address several aspects arising in your problem specification. However, for this 'first draft' you are creating a naïve Test Suite with only one requirement:

  1. Check that my submitted code reliably returns sufficiently accurate values for sine of many different angles. Use the assert function to generate errors/exceptions if the values are not sufficiently accurate.

You can use the functions sind, sin, etc. in this draft Test Suite, if you want — even though this would be bad practice in your final Test Suite!

Thus, the above specification is merely a starting point. You will develop more robust Test Suites in:

Solution Stats

10.94% Correct | 89.06% Incorrect
Last Solution submitted on Aug 25, 2021

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers5

Suggested Problems

More from this Author32

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!