News for hackers. Stuff that matters.
Re:Pynguin – Generate Python unit tests automatically by zerof1l on Tuesday June 01, 2021 @01:25AM (#27350978)
The decision is actually 5 different variables. Types are: boolean, a decimal percent and integer being a monetary value. The domain is fintech: making a decision on how much money to give and some other aspects about the loan.
Re:Pynguin – Generate Python unit tests automatically by 4140tm on Tuesday June 01, 2021 @02:46AM (#27351361)
> The domain is fintech

What you describe is the opposite of what I expect from (modern) fintech.

* no tests

* god method with no proper documentation/requirements

* no one actually understanding the function deciding how much money to send! Isn't this one of the core functionalities of fintech products?

Re:Pynguin – Generate Python unit tests automatically by stjohnswarts on Tuesday June 01, 2021 @09:41AM (#27354308)
Just plain scary especially with money if they can't at the very least test the extremes and some in the middle values. Good gravy! What is the name of this company so I can avoid it...
Re:Pynguin – Generate Python unit tests automatically by choeger on Tuesday June 01, 2021 @02:08AM (#27351169)
That sounds like no one knows what the correct result is.
Re:Pynguin – Generate Python unit tests automatically by cjfd on Tuesday June 01, 2021 @03:24AM (#27351561)
The whole thing does not sound very competent. Like noone could possibly guarantee that the result is not off by a factor of 2 or 3 or perhaps even 10 or more in some cases. What would happen in that case? It also sounds like a domain where mistakes could be very expensive or lead to lawsuits or similar such things.
Re:Pynguin – Generate Python unit tests automatically by zerof1l on Tuesday June 01, 2021 @04:59AM (#27352030)
Things are not that bad. While the whole thing is kind of a monolith, there are at least broad sections that split code into logical sections. With some practice, it is possible to easily narrow down changes and any issues to 10-20 LOC. Later, breaking code by them could be a starting place for refactoring. In the end, the decision is manually reviewed. There's also a log that tells how and why the code had arrived at the numbers. So, if you know that client cannot be X but the log says X then you know that there's a bug for example.

This code was around before I joined. It started small, but more and more requirements were added until it became like that. Not much effort went into structuring it. Now it's my responsibility, and I'm trying to make it better for me and anyone who will have to deal with it in the future.

Re:Pynguin – Generate Python unit tests automatically by totorovirus on Tuesday June 01, 2021 @03:35AM (#27351615)
Does this mean there are at least 2^5 = 32 paths that a procedure can take? Seriously, is it even documentable?