Search This Blog

Code snippets and memory joggers

Saturday, January 21, 2017

Test-Driven Development for the Web, with Python, Selenium, Django, JavaScript - Motivation



This is the first in a series of posts that describe me putting some concerted effort into the process of learning about the Django framework and applying some coding best practice.

Test-Driven Development

Over recent months I have been developing my code with a mind to making it Unit Test friendly.
I have spotted that the biggest issue with Unit Testing, for me, is that the code I have already written does not lend itself well to Unit Tests. A couple of the issues are the use closely coupled objects and methods that do more than one thing at a time.
Closely Coupled objects mean that mocking function is a time consuming and difficult process.
Methods that do more than one thing dissipate the the effectiveness of testing, requiring more effort to determine the actual issue encountered.
All this extra effort means that creation of the tests are less likely to be done wit a deadline looming.

The Web

In my work, the code I write, provides processes that take client or supplier data and transform it with business rules into data that our database based web applications can use. I have almost nothing to do with the development of those web applications which are written buy three other developers in our team using C# in a windows environment.
Everything I do for the company is happening in the background and I feel in general is unappreciated by the majority of my colleagues. The human race, on the whole, is a very visually orientated species, myself included. I'd like to be able to provide a useful "full-stack" product, mostly to satisfy this human trait in myself.

Selenium

Heck! I have never heard of it nor do I know, at this point, what it is or what it is for. I guess I'll find out with this tutorial.

Django

I have been thinking about developing my knowledge of Django for about a few years now.
I've dipped my toe into the water a couple of times but found other things to do. I have worked through the Django tutorial but have only made one attempt to produce anything other.
I found that there were some blockers to resolving some of the issues that came up. Changes made to the database were clunky to implement, I hope this has now been resolved with the current version.
Then, as I said, the rest of life took over.
Django seems now to becoming quite a mature product with a lot of contribution that enables a developer to produce product quickly. Not only that but when looking at the job postings experienced developers seem to be payed 2-3 times what I'm getting paid now!

Python3

I have also been developing using Python 2.7, I would like to produce something that works with Python3. The last time I assessed Python3 it lacked various support of widely used libraries. This was some 7 years ago though,


All this in mind has lead me to the tutorial "Test-Driven Development with Python"
To quote the site "TDD for the Web, with Python, Selenium, Django, JavaScript and pals..."

next - Installation

No comments:

About Me

I love to travel and meet new people, motorbikes, moving my body through dance, martial arts and yoga. I'm a lifelong learner interested in how things work, and the way people think and make their decisions. My choice of superpower would be to speak with someone and understand them completely, including their intention and for me to be able to communicate my intention to them clearly in their own language. As an Amazon Associate, I may earn from links to qualifying purchases.