Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Notas de lectura

CO2401 Software Development Lecture 12 Notes

Puntuación
-
Vendido
-
Páginas
4
Subido en
22-08-2024
Escrito en
2023/2024

This document contains detailed notes from Lecture 12 of the CO2401 course on Software Development. The lecture focuses on advanced unit testing techniques, specifically the use of mocking frameworks to simulate and test interactions between a unit of code and its dependencies.

Mostrar más Leer menos
Institución
Grado

Vista previa del contenido

CO2401: Software Development
Lecture 12

Recap: Terminology and Principles Related to Mocking Frameworks
1. Mocking:
o Mock Objects: Simulated objects that mimic the behavior of real
objects in controlled ways, used to test the interactions of a unit
with its dependencies.
o Purpose: Helps isolate the unit under test by simulating the
behavior of its dependencies, ensuring the test focuses solely on
the unit itself.
2. Why Use Mocking Frameworks?
o Efficiency: Hand-coding stubs and mocks is time-consuming and
prone to errors. Mocking frameworks automate the creation of fake
objects, making tests easier to write, read, and maintain.
o Popular Frameworks: MOQ, FakeItEasy, NSubstitute. NSubstitute
is highlighted for its focus on test readability and familiar syntax.
Interaction Testing
1. Types of Testing in Unit Tests:
o Value-Based Testing: Validates the return values of a method.

o State-Based Testing: Ensures that the internal state of the unit
under test changes as expected.
o Interaction Testing: Verifies that the unit under test interacts
correctly with other objects by calling their methods.
2. When to Use Interaction Testing:
o Interaction testing is essential when the primary outcome of a unit
of work is calling a method on another object. Mock objects help
verify that these interactions occur as expected.

Escuela, estudio y materia

Institución
Estudio
Desconocido
Grado

Información del documento

Subido en
22 de agosto de 2024
Número de páginas
4
Escrito en
2023/2024
Tipo
NOTAS DE LECTURA
Profesor(es)
Muhammad alhassan
Contiene
Todas las clases

Temas

$5.46
Accede al documento completo:

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF


Documento también disponible en un lote

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
BpoBpo University of Central Lancashire Preston
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
311
Miembro desde
5 año
Número de seguidores
250
Documentos
78
Última venta
3 días hace

3.7

73 reseñas

5
27
4
17
3
17
2
5
1
7

Documentos populares

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes