Throwaway code. If the code will be used only once, and it is not important that it works right, and if ever the need to modify the code arises you can afford to rewrite it, there might not be benefit from writing high quality code and tests. But when the code gets bigger, or you need to maintain it, or it is important for the code to work right, writing tests is worth the effort. I once heard somebody say that if he writes more than 10 lines of code without tests, then he begins to be unsure whether the code he just wrote will work right.