Indeed, *[knee][1]* may convey a connotation of tiredness, sublission or defeat, not what we are looking for.

Am I correct to believe that "on a knee" means that you had to do something quickly because there was no time, *like a hunter who shoots kneeling because they need to do it fast, without the time to find a proper support for the rifle*? Of course the result would be less precise [(see brief description here)][2] than e.g. leaning the rifle on a tree, being prone, or prone with a bipod, etc.

The connotation here is the **time constraint**.

[![Kneeling position][3]][3]

In that case, a close equivalent (meaning and connotation) would be **in a pinch**:

> **pinch**:  An emergency situation: *This coat will do in a pinch.* ([American Heritage][4])

Hence your sentence:

> There are lots of bugs in this application! They **wrote it in a pinch**, they did not even have time enough to perform unit testing...

And the student who had not done her/his homework the day before, did it **in a pinch** (and therefore not terribly well).

  [1]: https://www.merriam-webster.com/dictionary/knee
  [2]: http://outdoorhill.com/5-basic-shooting-positions-for-professional-hunters/
  [3]: https://i.sstatic.net/MTEci.jpg
  [4]: http://%20An%20emergency%20situation:%20This%20coat%20will%20do%20in%20a%20pinch.