英文:
Documenting Unit tests in Go
问题
在Go中编写单元测试的人,你们是如何记录它们的呢?
是否有某种类似于Python中的“docstring”约定?
如果有,那么你们是如何维护这些文档的呢?
是否有可能使用某种自动化工具根据单元测试的描述生成文档?
我之所以问这个问题,是因为作为团队中的QA人员,我希望记录这些测试并将其作为持续开发周期的一部分进行维护。
英文:
Whoever writes unit tests in Go, how are you documenting them?
Is there some kind of 'docstring' (like in Python) convention?
If so, how do you maintain this documentation afterwards?
Is it possible to generate Docs based on the description from Unit tests with some automatic tool?
I am asking because as a QA person in my team i wish to document those tests and maintain them as a part of an ongoing dev cycle.
答案1
得分: 2
谁在GoLang中编写单元测试,你是如何记录它们的?
没有以任何系统化的方式记录(如果有的话)。
是否有某种类似于Python中的“docstring”约定?
没有。(当然,对于可执行的“示例”是有的。)
如果有的话,你是如何维护这些文档的?
不适用。没有需要维护的内容。
是否可以使用某些自动化工具根据单元测试的描述生成文档?
在SO上询问第三方软件/库是不相关的。
英文:
> Whoever writes unit tests in GoLang, how are you documenting them?
Not in any systematic way (if at all).
> Is there some kind of 'docstring' (like in Python) convention?
No. (For executable examples there is of course.)
> If so, how do you maintain this documentation afterwards?
NA. Nothing to maintain.
> Is it possible to generate Docs based on the description from Unit tests with some automatic tool?
Asking for 3rd party software/libraries is offtopic on SO.
答案2
得分: 0
关于自动文档,可以查看godoc - https://go.dev/blog/godoc
我不知道关于golang中单元测试的具体用法(每个人都使用它,就像其他语言一样),但除了单元测试之外,BDD也很流行,你可以查看godog - https://github.com/cucumber/godog
关于“在SO上询问第三方软件/库是离题的” - golang就是关于第三方库的
附注:也许你可以使用模式godo(.{1})
来查找go的任何包
英文:
about automatic documentation, take a look on godoc - https://go.dev/blog/godoc
i don't know about specific usage of unit-test in golang (everyone using it - same as in other languages), but besides them bdd is also popular, for such a stuff take a look on godog - https://github.com/cucumber/godog
about Asking for 3rd party software/libraries is offtopic on SO
- golang is all about 3rd party libraries
p.s. probably you can use pattern godo(.{1})
to find any packages for go
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论