5 ms·
How about BDD, test-driven development and quality insurance? Does Go provide an ecosystem that supports agile refactorings that are common in lean startups? Y
by rmoriz 14y ago
How about BDD, test-driven development and quality insurance? Does Go provide an ecosystem that supports agile refactorings that are common in lean startups?
You can say anything bad about the performance of Ruby and Rails etc. but rspec, cucumber, capybara, vcr, factorygirl are really important features to start from zero and reach a viable product.
- burntsushi 14y ago> test-driven development `go test`. > Does Go provide an ecosystem that supports agile refactorings that are common in lean startups? Go has a compiler and is staticly and strongly typed. Which automatically makes it at least an order of magnitude easier to refactor safely. Not really sure about the other stuff you mentioned. I've never even heard of BDD before.
- gregors 14y agoI've heard this argument before e.g. we don't need to test because the compiler catches errors. The compiler catches the mot trivial of error conditions. Unfortunately it doesn't address faulty logic/behavior.
- GhotiFish 14y agoI rather like what go has set up for test's. They made it as small and functional as they could. Out of curiosity. How does a language specifically support "agile refactoring"? What features permit (or hinder) stopping every couple of weeks and removing the accumulated WTF's in the codebade? Want to buy a left handed stapler?
- paddyforan 14y agoGo's interfaces make it really, really easy to change things with very little code changing. Go's testing tools are superb.
- rmoriz 14y agoCan you blog about it in the future? Couldn't find good resources and tools about testing in Go. Especially with concurrency this seems to be very important.
- paddyforan 14y agoTesting: http://golang.org/doc/code.html#Testing http://golang.org/doc/code.html#Testing Iterating: http://vimeo.com/53221560 http://vimeo.com/53221560
- rmoriz 14y agofrom a testing point of view this looks pretty week. I would not bet my business on something that has not a testing culture.
- paddyforan 14y agoI wouldn't say Go doesn't have a testing culture. On what basis do you make that assertion? I write better tests for my Go code than for any code in other languages that I write. But maybe I just think in complementary ways to Go's testing philosophy.
- burntsushi 14y agoWhat? Go check out any moderately popular library in Go (including packages in the standard library), and I bet you're fairly likely to see a `*_test.go` file somewhere (perhaps more than one). Unit testing in Go is refreshingly simple. And it comes standard with the Go toolchain.
- enneff 14y agoThe talk that I gave just before the one linked above talks about testing: http://vimeo.com/53221558 http://vimeo.com/53221558
- codygman 14y agoWhat makes you say it doesn't have a testing culture? I think you're just trying to justify not using Go and sticking to your choice. I haven't came across any Go libraries without tests.
- trungonnews 14y agoGo doesn't have any mocking framework like Mockito/Java or Rspec mock. You will end up writing a ton of code yourself if you want to mock something simple.
- drivebyacct2 14y agoUh what? No, that couldn't possibly be less true. Have you ever heard of "interfaces" in Go? They're kind of an important feature.
- trungonnews 14y agoThat's what the other gophers say too. Java has interfaces too, but it also has Mockito that makes testing much easier. You should look into it. Mocking library will help reduce boiler code. You would know that if you had used one.
- drivebyacct2 14y ago>You would know that if you had used one. Cute.
- trungonnews 14y agoMy bad. :)
- burntsushi 14y agoGo interfaces are not the same as Java interfaces. Go interfaces are implemented using structural sub-typing.
- prodigal_erik 14y agoI've only dabbled a bit but I haven't seen a DSL that easily creates a mock that implements all the methods of a given interface, verifies that methods were (not) called with expected arguments, and returns or throws canned values. It's not difficult to write mocks from scratch, but it's very repetitive and hard to skim what the test does.