Sebastien ๐Ÿ’ป Garcia on LinkedIn: I just saw someone talking about not using In Memory implementation forโ€ฆ (2024)

Sebastien ๐Ÿ’ป Garcia

Lead Developer chez Travaux.com/Instapro Group

  • Report this post

I just saw someone talking about not using In Memory implementation for the DB in integration tests.And I think that requires a little global reminder :- ALL your tests must test the BUSINESS logic. Nothing else. No one cares that the method "save" was called once. But we do care that the user was created properly.- Your unit tests are NOT here to test your class. It tests the logic implementation of your business. It can be an aggregate : as long as there is a business logic, you test it using a unit test. You should test by creating your class manually and use test doubles for your dependencies, avoiding the mocks as much as possible as they have several unwanted risks.- Your integration tests are here to test your business against a code you don't own. You use a dependency injection component ? Test your business using it. You use an ORM with a MySQL implementation in production ? Do the same in the integration tests.And remember: always test the BUSINESS, not your code. It ensures that your application does what it is supposed to AND serves as a documentation.-----Code as if the next person reading your code is a psychopath who knows where you live. Most of the time, it's you in 3 months.

2

Like Comment

To view or add a comment, sign in

More Relevant Posts

  • Daniel Mallott

    Head of Platform and Infrastructure @ e-conomic

    • Report this post

    Should you unit test your database code? Of course you should! I've just written a post outlining two approaches to SQL Server unit testing - one manual, and one using tSQLt.Check it out here: https://lnkd.in/dcPxWTFDShout out to Brent Ozar for the Stack Overflow database, and Bob Ward for kicking me in the rear to actually turn this conference talk into a blog post.

    Why You Should Unit Test Your Database danielmallott.com

    40

    1 Comment

    Like Comment

    To view or add a comment, sign in

  • Maria Zulfiqar

    Technical Lead (.Net) @DPL | .Net Expert | Senior Full Stack Software Engineer | Provide Technical Solutions to businesses from 11 Years. i love to play with code & enhance it, make it memory efficient :)

    • Report this post

    ๐“๐ก๐ž ๐‘๐ž๐ฉ๐จ๐ฌ๐ข๐ญ๐จ๐ซ๐ฒ ๐ฉ๐š๐ญ๐ญ๐ž๐ซ๐ง ๐ฆ๐š๐ค๐ž๐ฌ ๐ข๐ญ ๐ž๐š๐ฌ๐ข๐ž๐ซ ๐ญ๐จ ๐ญ๐ž๐ฌ๐ญ ๐ฒ๐จ๐ฎ๐ซ ๐š๐ฉ๐ฉ๐ฅ๐ข๐œ๐š๐ญ๐ข๐จ๐ง ๐ฅ๐จ๐ ๐ข๐œ!โœ” It allows you to easily test your application with unit tests.โœ”Place the repository interfaces in the domain model layer so Web API doesnโ€™t depend directly on infrastructure layer( actual repository classes)โœ” You can implement mock repositories that return fake data instead of data from the database.This decoupled approach allows you to create & run unit tests that focus the logic of your application without requiring connectivity to the database๐‘๐ฎ๐ง๐ง๐ข๐ง๐  ๐ก๐ฎ๐ง๐๐ซ๐ž๐๐ฌ ๐จ๐Ÿ ๐ญ๐ž๐ฌ๐ญ๐ฌ ๐š๐ ๐š๐ข๐ง๐ฌ๐ญ ๐š ๐๐š๐ญ๐š๐›๐š๐ฌ๐ž ๐ข๐ฌ ๐›๐š๐ ๐Ÿ๐จ๐ซ ๐ญ๐ฐ๐จ ๐ซ๐ž๐š๐ฌ๐จ๐ง๐ฌ.โœ… First It can take a long time because of the large number of tests.โœ…Second, the database records might change and impact the results of your tests

    • Sebastien ๐Ÿ’ป Garcia on LinkedIn: I just saw someone talking about not using In Memory implementation forโ€ฆ (8)
    Like Comment

    To view or add a comment, sign in

  • Milad Cheriki

    Software Engineer | Former VP of Engineering | .NET Expert | Tech Leadership | Code Artisan

    • Report this post

    Leverage the power of EF Core Migration Bundles for an enhanced approach to managing and streamlining your database migrations. When used in tandem with Helm charts, migrations can be seamlessly integrated into your CI/CD pipeline, resulting in simplified deployments and minimized potential conflicts.Discover the key benefits of using EF Core Migration Bundles:- Consolidation of all pending migrations into a single executable- Streamlined application deployment- Reduced risk of conflicts in the migration process- Greater manageability and oversightThese tools are an indispensable addition to your software development toolkit, driving efficiency and reliability in your database migration process. It's time to unleash the potential of EF Core Migration Bundles and Helm charts in your projects.EF Core Migration Bundles: https://lnkd.in/dz3J5tzU#EFCore #DatabaseMigration #MigrationBundles

    Applying Migrations - EF Core learn.microsoft.com

    26

    Like Comment

    To view or add a comment, sign in

  • Steve โ€œardalisโ€ Smith โœ”

    I help financial services companies beat their competitors with technology.

    • Report this post

    Regardless of whether your C# entities are written first or the database is, somewhere you need to have mapping information to let Entity Framework know how it should store and retrieve data representing them.https://bit.ly/3X2yNPd#efcore

    Configuring Entities in EF Core ardalis.com

    22

    3 Comments

    Like Comment

    To view or add a comment, sign in

  • Karan Gill

    Student at National Institute of Technology Hamirpur

    I'm here to share a latest update in our ongoing project aimed at enhancing data management efficiency. Our latest focus has been on empowering admin users to effortlessly update website information using a simple CSV upload feature directly from the frontend.Through the seamless integration of Multer middleware, we've revolutionized the process of updating website content. Admin users can now upload CSV files containing the latest information directly through the frontend interface, eliminating the need for complex manual interventions via Postman or backend scripts.This enhancement not only simplifies the data update process but also significantly enhances the user experience, allowing admins to make quick updates without relying on technical expertise or backend access.The true game-changer in this update is by CSV parsing tool, which efficiently converts the uploaded CSV data into JSON format. This streamlined conversion process ensures seamless integration with our database, enabling real-time updates to website content.

    10

    1 Comment

    Like Comment

    To view or add a comment, sign in

  • Aymen FARHANI

    • Report this post

    #springframework #transactionmanagement *) What is a transaction?A transaction refers to a set of related operations that are performed as a single unit of work. It ensures that all or none of the operations are completed successfully. Transactions are useful when multiple database operations need to be performed together, and if any error occurs during the transaction, it can be rolled back to restore the initial state.*) How @Transactional works in Spring?@Transactional is an annotation provided by the Spring framework. It is used to define the transactional behavior for methods or classes.When @Transactional is added to a method or class, Spring wraps the method or class within a transaction. This means that if an exception is thrown during the execution of the method, the transaction will be rolled back and any changes made within the method will be reverted.Transactional behavior can be configured using various attributes of @Transactional, such as isolation level, propagation behavior, rollback rules, and timeout. These attributes can be used to control the behavior of transactions according to specific requirements.In Spring, @Transactional works based on proxies. Spring dynamically generates a proxy implementation for the transactional bean and intercepts the method calls. It then applies the transactional behavior before and after the method execution.To use @Transactional in Spring, you need to enable transaction management by either using the @EnableTransactionManagement annotation or configuring it in XML-based configuration. Once enabled, you can annotate any method or class with @Transactional to enable transactional behavior.

    10

    Like Comment

    To view or add a comment, sign in

  • Matthew Arnold

    Pro Match Insights: Transforming Trades Recruitment and Lead Generation

    • Report this post

    Part II - The following is the remaining list of misc. software code functions in order of which they're typically produced:26. **Search Functionality:** Implementing search features based on user queries.27. **Encryption/Decryption Logic:** Implementing algorithms for data security.28. **Data Serialization/Deserialization:** Converting data to and from different formats (e.g., JSON, XML).29. **Dependency Management:** Managing external dependencies and libraries.30. **Configuration Setup:** Establishing basic settings and configurations for the software.31. **Middleware Configuration:** Configuring middleware for handling cross-cutting concerns.32. **Code Documentation:** Writing documentation for the codebase.33. **Testing Code:** Writing tests to ensure the functionality and reliability of the software.34. **Logging Configuration:** Setting up logging for tracking events and errors.35. **Concurrency Control:** Managing and handling concurrent execution of code.36. **Error Handling:** Implementing mechanisms to handle errors gracefully.37. **Transaction Handling:** Managing transactions to ensure data consistency.

    Like Comment

    To view or add a comment, sign in

  • Real Python

    206,963 followers

    • Report this post

    ๐Ÿ๐Ÿ“ฐ What Are CRUD Operations?CRUD operations are the cornerstone of application functionality. Whether you access a database or interact with a REST API, you usually want to create, retrieve, update, and delete data. In this tutorial, you'll explore how CRUD operations work in practicehttps://buff.ly/3KjLvno

    • Sebastien ๐Ÿ’ป Garcia on LinkedIn: I just saw someone talking about not using In Memory implementation forโ€ฆ (26)

    31

    Like Comment

    To view or add a comment, sign in

  • Sabbir Siddiqui

    Senior Engineering Manager @ Optimizely

    • Report this post

    When I am building any API, these are the top 4 things I try to always consider regardless of the language or framework (or requirements):1. Request validation - Query, path or body json parameters - all should be validated through some standard schema or validation mechanism supported by your framework for consistent checking and error messages. This is not only for the request layer, but internally while implementing business logic, it's important to validate nulls or undefined values.2. Security - Usually authentication and authorization are handled by middleware, but sometimes business logic dictates the permission level of the API. For example, you have to query some data and return only the relevant data filtered by the user ID of the request (authenticated) user, on top of checking authorization. (AKA row level auth)3. Error handling - Unhandled exceptions should be managed through some central error handler in your framework, but otherwise business logic specific error handling should be considered. For those scenarios having custom exceptions kept in a central location can help manage all the possible exceptions your system can throw. 4. Logging - Request and response logging can be done at the framework level with some middleware (with some request ID for tracing). For API specific logging or error tracing, it's important to log key information that can help identify specific errors or steps in the logic. If possible include the request ID as a log prefix (this can also be done from a framework level).There are a bunch more things to keep in mind like proper status codes, caching, rate limiting, documentation etc some of which are handled by the framework by default, and others depending on the scenario.What other aspects are important to you while building APIs? Comment below!Please like and repost if you found this useful!#restapi #softwareengineering #bestpractices #softwaredevelopment #apibestpractices

    292

    51 Comments

    Like Comment

    To view or add a comment, sign in

  • Chathura Rupasinghe

    Assistant Vice President at OCBC

    • Report this post

    Importance of automated tests!!

    4

    Like Comment

    To view or add a comment, sign in

Sebastien ๐Ÿ’ป Garcia on LinkedIn: I just saw someone talking about not using In Memory implementation forโ€ฆ (37)

Sebastien ๐Ÿ’ป Garcia on LinkedIn: I just saw someone talking about not using In Memory implementation forโ€ฆ (38)

655 followers

  • 99 Posts

View Profile

Follow

Explore topics

  • Sales
  • Marketing
  • Business Administration
  • HR Management
  • Content Management
  • Engineering
  • Soft Skills
  • See All
Sebastien ๐Ÿ’ป Garcia on LinkedIn: I just saw someone talking about not using In Memory implementation forโ€ฆ (2024)
Top Articles
New tiredness study reveals why a day of hard thinking is so exhausting
50 Super Sweet Nicknames to Call Your Boyfriend
Fernald Gun And Knife Show
St Thomas Usvi Craigslist
Christian McCaffrey loses fumble to open Super Bowl LVIII
Lifebridge Healthstream
Southeast Iowa Buy Sell Trade
Western Razor David Angelo Net Worth
Visustella Battle Core
123Moviescloud
Busty Bruce Lee
735 Reeds Avenue 737 & 739 Reeds Ave., Red Bluff, CA 96080 - MLS# 20240686 | CENTURY 21
2016 Ford Fusion Belt Diagram
No Hard Feelings Showtimes Near Cinemark At Harlingen
Busted Barren County Ky
Truth Of God Schedule 2023
Used Sawmill For Sale - Craigslist Near Tennessee
Does Breckie Hill Have An Only Fans โ€“ Repeat Replay
Everything We Know About Gladiator 2
Water Days For Modesto Ca
V-Pay: Sicherheit, Kosten und Alternativen - BankingGeek
Energy Healing Conference Utah
Catherine Christiane Cruz
Timeforce Choctaw
Ppm Claims Amynta
The Weather Channel Local Weather Forecast
Amazing Lash Studio Casa Linda
Cookie Clicker Advanced Method Unblocked
Mythical Escapee Of Crete
Horn Rank
Strange World Showtimes Near Savoy 16
Helpers Needed At Once Bug Fables
Mta Bus Forums
Receptionist Position Near Me
The Bold and the Beautiful
Royal Caribbean Luggage Tags Pending
Santa Cruz California Craigslist
Andhra Jyothi Telugu News Paper
Property Skipper Bermuda
Temu Y2K
Craigslist Putnam Valley Ny
Search All of Craigslist: A Comprehensive Guide - First Republic Craigslist
Executive Lounge - Alle Informationen zu der Lounge | reisetopia Basics
Login
Po Box 101584 Nashville Tn
Jammiah Broomfield Ig
Holzer Athena Portal
Port Huron Newspaper
Greatpeople.me Login Schedule
Vci Classified Paducah
Michaelangelo's Monkey Junction
Emmi-Sellers
Latest Posts
Article information

Author: Rubie Ullrich

Last Updated:

Views: 6323

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Rubie Ullrich

Birthday: 1998-02-02

Address: 743 Stoltenberg Center, Genovevaville, NJ 59925-3119

Phone: +2202978377583

Job: Administration Engineer

Hobby: Surfing, Sailing, Listening to music, Web surfing, Kitesurfing, Geocaching, Backpacking

Introduction: My name is Rubie Ullrich, I am a enthusiastic, perfect, tender, vivacious, talented, famous, delightful person who loves writing and wants to share my knowledge and understanding with you.