Você não tem acesso a esta aula

Continue aprendendo! Junte-se e comece a impulsionar sua carreira

Understanding the principles of defensive development

13/25
Recursos

Como desarrollador o desarrolladora de software eres responsable no solo de la calidad del código que escribes, sino también de la seguridad y el cuidado del mismo.

Defiende tu software de ti mismo y de tus compañeros

Procura cuidar tu software no solo de otras personas, también de ti mismo. Si tienes necesidad de refactorizar tu código o trabajar en el que escribiste hace meses/años, puedes introducir bugs en el mismo al no recordar qué has hecho aquí.

  • Talk to your teammates and make sure their number one priority is protecting that advantage that you have just gotten.
  • This is where the concept of Defensive Development comes from.
  • Once you have reached a point where your software is working, you need to protect it and make sure it continues working.

Let’s look at some techniques to do that:

Técnica #1 - Control de versiones con tu repositorio de código

En el desarrollo de software tradicional, no utilizar un control de versiones como GIT no es una opción.

  • Version Control is a super cool technology you can use, it’s one of the best defensive tools.
  • VC software helps you keep track of changes made to your code.
  • VS allows you to control different versions of your files, different versions of your code, and different versions of what you have committed.

Control de versiones con tu repositorio de código

  • Committing is a very important word here - saving your files onto the version control software. You are committing new versions of your files into your VC repository.
  • You commit those changes to your branch or branches.
  • The Branch is the file of code you are working on.
  • Within this branch, you can have additional branches, for different uses and modifications on different branches.
  • It lets multiple people check changes back into the repository and distribute them.
  • It keeps track of the history, who changes what, when, and why.
  • It tags, so you can find versions of your code from “way back when”.

Técnica #2 - Controla tus dependencias

Un proyecto de software tendrá N dependencias de terceros, código que tú ni tu equipo han escrito, pero dependes de él para que el mismo funcione. Llevar un control de qué dependencias utilizas es muy importante.

  • Dependencies make your code more complex.
  • Sometimes you want to test some functionality of your code, but that functionality is tied to another task you haven’t done yet.
  • Real-World code always has dependencies, it’s never isolated.
  • Sometimes you have code that depends on something external, like a database.
  • You have to figure out a way to test that functionality independent of those dependencies.
  • Always check your dependencies for connectivity necessities.
  • You need to find a way to keep things independent but work together at the same time to make testing easier.

Test-Driven Development (TDD)

El Test-Driven Development (TDD) es una de las metodologías más populares para escribir pruebas de software.

Código que prueba tu código.

  • TDD = Doing everything with testing in mind, writing tests before the code.
  • This approach ensures that Developers clearly understand the specifications and requirements of features.
  • TDD is all about creating tests for individual pieces of functionality, and then writing code for that specific functionality.

Cuidar el código de un proyecto es trabajo de todo el equipo. Llegar a un acuerdo sobre qué metodologías utilizarán, cómo versionarán el código, cómo escribirán las pruebas. Son charlas que tú y tu equipo deben tener antes de comenzar un proyecto.


Contribución creada por: Kevin Fiorentino.

Contribuições 0

Perguntas 0

Ordenar por:

Quer ver mais contribuições, perguntas e respostas da comunidade?