TGTGInsightтелеграм анализLIVE / telegram public index
← Такты, стеки, два колеса

TGINSIGHT SIMILAR POSTS

Намери подобно съдържание

Изходен канал @clockstackwheels · Post #227 · 20.02

Допустим, вы разработчик, и вам от пользователя приходит строка user-agent с описанием того, каким браузером он пользуется. В этой строке будет что-то типа такого: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36 И вы хотите из неё узнать мажорную версию Chrome, то есть вытащить число 51. Что вы сделаете? Можно, конечно, написать свой парсер, но я уверен, многие воспользуются регулярными выражениями. Я бы воспользовался. Какое выражение сюда подходит? С виду кажется, что вот такое: /Chrome\/(\d\d)\./g Мы ищем слово Chrome и слэш, затем ловим в группу две цифры, после которых стоит точка. Так? По крайней мере, мышление достаточного количества разработчиков именно таково. Зачастую программистам не хватает умения отойти от техзадания на уровень вещественной сути того, с чем они работают. На самом деле число 51 это версия. Версия будет увеличиваться со временем. «Марти, где твоё четырёхмерное воображение?» Если уже прошло 50 версий, то и следующие 50 не за горами, число станет трёхзначным, регулярка или парсер, сделанные под двухзначные числа, перестанут работать. Трехзначная версия Chrome и Firefox приближается уже сейчас. И да, в них падает куча функций на сайтах, включая крупные корпорации: Yahoo, Bethesda, HBO и бог знает сколько сайтов поменьше. Чисто из-за цифры. Это уже назвали «Проблема сотой версии» по аналогии с «Проблемой 2000 года» (программисты записывали год двумя цифрами, 2000 стал неотличим от 1900). К чему это я? Полезно задумываться о физическом воплощении того, что вы представляете в своей программе. Ваш код должен описывать не столько требования заказчика, сколько законы, по которым существует этот объект в реальном мире. #dev

Hashtags

Резултати

Намерени 4 подобни публикации

Търсене: #bdd

当前筛选 #bdd清除筛选
djangoproject

@djangoproject · Post #335 · 09.05.2017 г., 05:22

https://code.tutsplus.com/tutorials/behavior-driven-development-in-python--net-26547 Behavior-Driven Development (which we will now refer to as "#BDD") follows on from the ideas and principles introduced in #Test-Driven Development. The key points of writing tests before code really apply to BDD as well. The idea is to not only test your code at the granular level with unit tests, but also test your application end to end, using acceptance tests. We will introduce this style of testing with the use of the Lettuce testing framework.

Hashtags

djangoproject

@djangoproject · Post #199 · 29.11.2016 г., 16:13

http://pythonhosted.org/behave/ behave is behaviour-driven development, Python style. Behavior-driven development (or #BDD) is an agile software development technique that encourages collaboration between developers, #QA and non-technical or business participants in a software project. We have a page further describing this philosophy. behave uses tests written in a natural language style, backed up by Python code. Once you’ve installed behave, we recommend reading the tutorial first and then feature test setup, behave API and related software (things that you can combine with behave) finally: how to use and configure the behave tool.

Hashtags

djangoproject

@djangoproject · Post #552 · 23.01.2018 г., 16:33

https://pypi.python.org/pypi/pytest-bdd #BDD library for the py.test runner #pytest-bdd implements a subset of Gherkin language for the automation of the project requirements testing and easier behavioral driven development. Unlike many other BDD tools it doesn’t require a separate runner and benefits from the power and flexibility of the #pytest. It allows to unify your unit and functional #tests, easier continuous integration server configuration and maximal reuse of the tests setup. Pytest fixtures written for the #unit_test s can be reused for the setup and actions mentioned in the feature steps with dependency injection, which allows a true BDD just-enough specification of the requirements without maintaining any context object containing the side effects of the Gherkin. imperative declarations.