Hacker News new | ask | show | jobs
by nathanwh 1215 days ago
Until someone makes the AI write the test too, I don't think there's going to be any red-tape style solutions to this problem that isn't just "no AI written code allowed".
2 comments

What's more likely to happen is "no human written code allowed". I could easily imagine a future where people are socially ostracized for writing code manually because it's dangerous, unsafe, and insecure. In that future, Rust developers will get a taste of how they made C / C++ programmers feel.
I mean either it works or it doesn't. That is, either I can ask the AI to solve literally any problem that I have or I still need a software engineer to tell me why my goals are stupid and ill formed.

So for example I ask the AI to program a replacement for dentists. The AI tells me that you can't fix dentistry with software. So I ask it what could fix dentistry and ask it to program that. And the AI can't program that either. But you just keep asking for the solution to the thing that the AI cant solve and eventually you get it to spit out some gcode for a 3D printer and you bootstrap your way up to AI replaced dentistry.

So either the AI can replace anything or you need some person who can translate domain knowledge into source code.

Yeah eventually rust devs get their comeuppance but in that day they're also the last employed human profession.

Traditionally speaking people used the word God to describe someone who's capable of solving every problem. Talk about raising the bar. Sure you'll need a person. That person could be an AI.
> Talk about raising the bar.

Uh, no I guess my point is that once all of the programmers/software engineers/software developers are out of a job, then everyone else will be as well. I think that if there's literally anyone else working because the AI can't do their job in totality, then there's also a (potential) reason for that person to want some sort of human software developer.

But when everyone can avoid human software developers because the AI can do it, then everyone else can avoid every human professional because the AI can do it.

It would not surprise me if this is a gradual process where at some point there is a 50/50 mix of humans and AI doing software development.

Actually, it probably could write really good test cases. they tend to be boring and verbose.

It's only test data but you get the point

Sure, here are some examples of phone numbers in various formats:

(123) 456-7890 123-456-7890 +1 (123) 456-7890 1-800-123-4567 555.123.4567 123.456.7890 1234567890 (123) 456-7890 ext. 123 +44 123 456 7890 (international format) 011 44 123 456 7890 (international access code format) 123/456-7890 123\456-7890 (123) 456-7890 x1234 (with extension) 123-456-7890 x1234 (with extension) 1 (123) 456-7890 (with country code)

I use Copilot to write my tests, but using ChatGPT to generate test data could be a good idea. I'll have to fiddle with it when i'm not on a timer.

Thank you for the suggestion.

Out of curiosity I tried chat GPT for this and it was able to generate a reasonable set of test cases but only after prompting it for including international access and "+" characters. I also had to prompt it to use the parameterize feature, but I guess that's personal preference.

Final test: https://pastebin.com/J36JY78i

First response: https://pastebin.com/S23GFPDq

All great test cases. Here are a few more test cases for valid phone numbers:

0893514656, 089 3514656, +49893514656, 08921610, 089 2 16 10, 08992949451 ...