News for hackers. Stuff that matters.
Re:Automated Unit Test Improvement Using Large Language Mode... by noisy_boy on Saturday February 17, 2024 @07:51AM (#39408999)
Sometimes the value you pass to a setter can go through additional logic to determine the final value to be set e.g.:

    private int value1;

    private int value2;

    public void setValue2(int value2) {
        this.value2 = value2;                  
    }
    
    public void setValue1(int value1) {
        if (this.value2 > 0) {
            this.value1 = value1 + this.value2;
        } else {
            this.value1 = value1;
        }
    }

Obviously this is a contrived example but if you have logic other than a simple "this.value = value", then you might want to unit test that bit.
Re:Automated Unit Test Improvement Using Large Language Mode... by tom_ on Saturday February 17, 2024 @09:59AM (#39410005)
Also useful if you want to add logging, or capture some metrics, or set a breakpoint.
Re:Automated Unit Test Improvement Using Large Language Mode... by growse on Saturday February 17, 2024 @12:28PM (#39411405)
Ah, the sound of people not using their type system properly.

Parse, don't validate.

Re:Automated Unit Test Improvement Using Large Language Mode... by reactordev on Saturday February 17, 2024 @12:42PM (#39411550)
But also don’t create AggregateNonNegativeInteger type when generics will do.