Read through the discourse posts below, people (including me) complain a lot on the way how tests work, and you can find some hints which forms you sohuld follow, what is expected order of operations, etc.

Please specify how to order the expression. Seems test cases has no rules for it. Which option should I follow: 1 + f(x) or f(x) + 1? And why is tan'(x) = 1 / cos(x)^2 rejected despite of the link in the description says this expression?

Random test quality is unacceptably terrible: they have simple, predetermined structures. AST katas need random tests of random ASTs to achieve acceptable test coverage

Missing lots of derivative test cases: n / n/n ^ n; f(x) / g(x); n ^ x/n ^ f(x); x ^ x/f(x) ^ g(x); sin/cos/tan/exp/ln with complicated arguments for chain rule...

Missing lots of simplification test cases: f(x) - 0; f(x)0 / f(x); f(x) / 1; 0 ^ n/1 ^ n/n ^ 0; as well as + and * simplification from both sides

There are some implicit assumptions on how to perform the derivative, e.g / if denominator is constant is different from if it's not; ^ is handled differently depending on whether either argument is constant.

Each kind of random test is only done once? That's not acceptable either; the standard is at least 100 random tests.

No, because it is a lack of test coverage, which is the fault of kata itself. As a kata author you have responsibility to make sure your test has enough coverage against all reasonable test cases, and x ^ x is definitely a very reasonable one.

The current random tests stops most of the obvious cheats. You are welcome to suggest test edits instead of just saying 'add random tests'.
I kind of assume people are here to learn, I dont understand what the joy is to to cheat on codewars.

Still can't sense what depth of simplification and derivation is expected.

For example, shall it simplify expressions like (1-x^2) / (1+x)^2 or more complicated polynomial expressions?

Or shall the code derive functions like (ax)^(bx)^(cx)?

In Haskell only

`1 + tan(x)^2`

is acceptedWhich language are you working with? Both versions of tan'(x) should be accepted, at least in the C#, Java and JS versions of the kata.

The expected format is given both by example tests and the way the derivation rules are described.

Read through the discourse posts below, people (including me) complain a lot on the way how tests work, and you can find some hints which forms you sohuld follow, what is expected order of operations, etc.

Please specify how to order the expression. Seems test cases has no rules for it. Which option should I follow:

`1 + f(x)`

or`f(x) + 1`

? And why is`tan'(x) = 1 / cos(x)^2`

rejected despite of the link in the description says this expression?This comment is hidden because it contains spoiler information about the solution

Re-raising the issues below and some more:

`n / n`

/`n ^ n`

;`f(x) / g(x)`

;`n ^ x`

/`n ^ f(x)`

;`x ^ x`

/`f(x) ^ g(x)`

;`sin`

/`cos`

/`tan`

/`exp`

/`ln`

with complicated arguments for chain rule...`f(x) - 0`

;`f(x)`

`0 / f(x)`

;`f(x) / 1`

;`0 ^ n`

/`1 ^ n`

/`n ^ 0`

; as well as`+`

and`*`

simplification from both sides`/`

if denominator is constant is different from if it's not;`^`

is handled differently depending on whether either argument is constant.once? That's not acceptable either; the standard is at least 100 random tests.It doesn't matter, as a kata author you

haveto add good quality random tests, or your kata is not compliant to kata QA requirements.No, because it is a lack of test coverage, which is the fault of kata itself. As a kata author you have responsibility to make sure your test has enough coverage against all reasonable test cases, and

`x ^ x`

is definitely a very reasonable one.Thanks. This should have been a suggestion and not marked as issue.

The current random tests stops most of the obvious cheats. You are welcome to suggest test edits instead of just saying 'add random tests'.

I kind of assume people are here to learn, I dont understand what the joy is to to cheat on codewars.

There should be tests with both sides of

`^`

being variables, e.g`x ^ x`

.This comment is hidden because it contains spoiler information about the solution

Approved. Thanks!

## Loading more items...