ISO 公共 Django 应用程序使用 Doctest、Unitests 和 Selenium 开发敏捷/BDD 风格

发布于 2024-08-14 08:08:36 字数 166 浏览 5 评论 0原文

我发现了几篇解释 TDD/BDD 的博客文章,但这些示例通常都很基础。通常它们仅适用于模特。我想看看人们如何在现实生活中真正使用 BDD。
我希望有人指出一些以测试优先的方式构建的 Django 应用程序,以便我可以向它们学习。

我知道 Rails 有很多例子,Django 当然也有一些例子。

I've found several blog posts where TDD/BDD is explained, but the examples are usually really basic. Usually they are just for Models. I want to see how people are really using BDD in Real Life.
I'd love be pointed towards some Django apps that were built test first style so I can learn from them.

I know that Rails had many examples, surely Django has a few examples too.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

巾帼英雄 2024-08-21 08:08:36

你可能已经做得对了。目前,有大量来自 Django 开发人员的博客文章,他们谈论如何正确进行 Django 开发以及如何解决测试一些重型内容的问题,但没有一个资源能够涵盖所有内容,尤其是使用 TDD 时只。

如果您喜欢阅读其他人的源代码,我认为您最好的途径是学习经验丰富的 Python 和 Django 开发人员如何施展魔法、管理、测试和重新分发他们的代码。

我建议您承诺跳转到 GitHubBitbucketGoogle 代码上的项目托管定期查询 Django 项目。参与一些小事情真是太好了,你可以快速投入并真正了解正在发生的事情,甚至可能更进一步,看看你可以如何做出贡献。

不幸的是,我不知道有任何 Django 项目附带了有关如何执行开发的文档。这并不是真正的狂野西部:有版本化的文档、愿望清单、问题跟踪器、待办事项、分支和标签,显示开发时间表,但并不完全涵盖从想法到完整、干净的实现的整个过程。

不幸的是,大多数书籍都涉及开发 Django 应用程序,但没有一套开发方法。我认为这很公平,因为人们有自己的做事方式和最适合他们的工具,而像这样的书需要至少 2000 页长才能涵盖所有变量。

我个人喜欢尝试做一些事情我自己,然后通过观察其他人为解决同一问题所做的事情来向他们学习;我觉得这让我对做事的正确、错误和原因有一个全面的认识。我最近使用 contentypes 框架将应用程序与我的项目解耦,但我对测试结果不太满意。然后我查看了 中的测试James Bennett 的 django-tagging 发现我的想法出了问题,这确实很有帮助我很多。

Your likely doing it right already. For the moment, there's an ample amount of blog posts from Django developers where they talk about doing Django development right and how they solved issues with testing some heavy-duty stuff, but not a single resource that covers it all, especially not with employing TDD exclusively.

If your into reading other people's source code, I think your on the best track of learning how experienced Python and Django developers do their magic, manage, test and redistribute their code.

I'd suggest you make a commitment to hop over to GitHub, Bitbucket or Project Hosting on Google Code regularly and query for Django projects. It's great to get involved with something small that you can quickly sink your teeth into and really understand whats going on and maybe even go a step further and see how you can contribute.

Unfortunately, I'm not aware of there being any Django project that's distributed with documentation on how development is being performed. It's not really the wild wild west: there's versioned documentation, wishlists, issue trackers, TODOs, branches and tags that show the development timelines, but not exactly something that covers the whole process from thought to a full, clean realization.

And too, unfortunately, most books deal with developing Django applications without a set development methodology. I think that's only fair, because people have their own way of doing things and tools that work best for them and a book like that would need to be at least 2000 pages long to cover all the variables..

I personally like to try doing something myself and then learn by example from other people by looking on what they've done to address the same problem; I feel that gives me a full perspective with the rights, wrongs and whys of doing things. I recently decoupled an app from my project by using the contentypes framework and I wasn't all too comfortable on how my tests turned out. I then looked at the tests from django-tagging by James Bennett and saw where my thinking went awry and it really helped me a lot.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文