This document discusses database unit testing. It defines unit testing as testing individual units of source code to determine if they are fit for use. Developers, DBAs, and QA engineers care about unit testing because it finds problems early, facilitates change, and simplifies integration. The document discusses test-driven development concepts and architectures. It notes that while the initial cost of writing unit tests is high, there are real benefits like thinking-driven development and documentation. The presentation demonstrates unit testing with Visual Studio and concludes with references on database unit testing tools and practices.
Database development unit test with tSQLtSergio Govoni
When we talk about unit test, we are actually talking about a software testing level that aims to test a discrete piece of code. The word “unit” refers to the smallest piece of code that can be tested separately. In a database solution, the unit is typically a stored procedure, a trigger or a user-defined function. When you start to think about unit test, it is very important to define the System Under Test (SUT) first and isolate it! Unit testing frameworks, stubs, mock and fake objects are used to assist in unit testing. In this session we will explore the techniques and tSQLt framework to start unit testing in your database development.
Demo scripts are available here: https://github.com/segovoni/sql-server-demos/tree/master/datasaturday/2021/datasat0001/database-development-unit-test-with-tSQLt
The Key Components of Adopting CI The OpenStack WayiWeb (group INAP)
Wajdi Al-Hawari, software developer for Internap, presented at OpenStack Day Canada showcasing how they revamped their Continuous Integration solution the OpenStack way.
Test Driven Development - a Practitioner’s PerspectiveMalinda Kapuruge
Guest lecture at Swinburne University of Technology, Melbourne. We introduced TDD concepts to students. We also did a live interactive demo with students to understand benefits of TDD.
Finally, we discussed benefits as well as pitfalls from a practitioner's point of view.
A method of communicating between two devices
A software function provided at a network address over the web with the service always on
It has an interface described in a machine-processable format
http://www.qualitestgroup.com/
Database development unit test with tSQLtSergio Govoni
When we talk about unit test, we are actually talking about a software testing level that aims to test a discrete piece of code. The word “unit” refers to the smallest piece of code that can be tested separately. In a database solution, the unit is typically a stored procedure, a trigger or a user-defined function. When you start to think about unit test, it is very important to define the System Under Test (SUT) first and isolate it! Unit testing frameworks, stubs, mock and fake objects are used to assist in unit testing. In this session we will explore the techniques and tSQLt framework to start unit testing in your database development.
Demo scripts are available here: https://github.com/segovoni/sql-server-demos/tree/master/datasaturday/2021/datasat0001/database-development-unit-test-with-tSQLt
The Key Components of Adopting CI The OpenStack WayiWeb (group INAP)
Wajdi Al-Hawari, software developer for Internap, presented at OpenStack Day Canada showcasing how they revamped their Continuous Integration solution the OpenStack way.
Test Driven Development - a Practitioner’s PerspectiveMalinda Kapuruge
Guest lecture at Swinburne University of Technology, Melbourne. We introduced TDD concepts to students. We also did a live interactive demo with students to understand benefits of TDD.
Finally, we discussed benefits as well as pitfalls from a practitioner's point of view.
A method of communicating between two devices
A software function provided at a network address over the web with the service always on
It has an interface described in a machine-processable format
http://www.qualitestgroup.com/
This presentation will give you a fuller understanding of unit testing in Swift, its benefits, key characteristics, mocks and stubs, dependency injection, DI patters and common mistakes one may make throughout the process.
This presentation by Andrii Gavrysh, GlobalLogic expert, was delivered at GlobalLogic Lviv iOS TechTalk on November 16, 2016.
Learn more: https://www.globallogic.com/ua/gl_news/globallogic-lviv-ios-techtalk-summary
We are entering a world where everything must be done quicker. You must deliver code faster. You must deploy faster. How can you deliver and deploy faster without compromising your professionalism? How can you be sure you are delivering what your client has asked you?
In short, testing is the only way to be sure you’re delivering what someone asked you to. Often we use BDD Tools such as FitNesse which gained popularity over the recent years
There are a number of integration / BDD test tools out there that help you deliver a high quality software through tests. Its easy to pick up any tool from just their tutorials and start writing tests. But as I found out the hard way, this can quickly spiral into a state where the tests are giving you and your team hell and are worth less than the value the tests are delivering.
Using FitNesse and Junit as examples, I will share things that I have learnt working on large enterprise and vendor systems and help you avoid your own path to hell.
Olli-Pekka Puolitaival - Model-Based Testing for Integration Testing in Real ...TEST Huddle
EuroSTAR Software Testing Conference 2012 presentation on Model-Based Testing for Integration Testing in Real Production by Olli-Pekka Puolitaival. See more at: http://conference.eurostarsoftwaretesting.com/past-presentations/
КОСТЯНТИН НАТАЛУХА «Setup and run automated test framework for Android applic...QADay
Kyiv Quality Assurance Day 2021
КОСТЯНТИН НАТАЛУХА
«Setup and run automated test framework for Android application»
Відео з презентації https://drive.google.com/file/d/1G3wK3ckSQhsedA9680Y7XQ_ztHhwRhJH/
Слідкуйте за нами:
Телеграм: t.me/goqameetup
Linkedin: linkedin.com/company/goqa
Fb: https://www.facebook.com/goqaevent
Fb: https://www.facebook.com/qaday.org
Youtube: https://www.youtube.com/channel/UCOyIrmpVbtqUZyRLxd9BKzA
HTML5 is one of the hottest technologies around right now because HTML5 apps are beautiful, engaging, and can perform important and entertaining functions. With the wide range of devices and platforms to support, the promise of multi-platform support is appealing. But HTML5 apps present their own range of security issues. So, what do you do about security? How do you test HTML5 applications to ensure their security? Alexander Andelkovic works at Spotify where their streaming music player desktop client applications are all HTML5-based. Alexander explains how manual testers can get the most out of HTML5 app security testing and manifest of HTML5 apps. He covers these common security testing issues and more: cross-site scripting (script inclusion), privacy-related issues, data leakage, and permissions. Discover how, by being proactive, you can avoid having to search for security issues late in a development project.
Leandro Melendez - Switching Performance Left & RightNeotys_Partner
Since its beginning, the Performance Advisory Council aims to promote engagement between various experts from around the world, to create relevant, value-added content sharing between members. For Neotys, to strengthen our position as a thought leader in load & performance testing. During this event, 12 participants convened in Chamonix (France) exploring several topics on the minds of today’s performance tester such as DevOps, Shift Left/Right, Test Automation, Blockchain and Artificial Intelligence.
Learn about the benefits of writing unit tests. You will spend less time fixing bugs and you will get a better design for your software. Some of the questions answered are:
Why should I, as a developer, write tests?
How can I improve the software design by writing tests?
How can I save time, by spending time writing tests?
When should I write unit tests and when should I write system tests?
Technologies like Squarespace, Salesforce, WordPress, or WIX are extremely popular for those who want to create a working website without necessary developer knowledge. In this talk, I would explore how Salesforce uses Page Object Model patterns to test its Communities platform which is used to develop websites for Salesforce users.
Throughout the talk, we will explore how multi-frame platform can be directly mapped to POM for Selenium Webdriver, and how client side code is developed to support this pattern.
The importance and complexity of these test framework is that it needs to be applicable for both platform and produced websites.
Recording: https://youtu.be/6opoooLdonI
This talk was give at the South Shore .NET Users Group.
Unit Testing is now considered a required skill for developers. There are a ton of tools out there. However, there's nothing that shows you how to tie them all together to make your software fast, testable, and flexible. This talk will go over my toolset:
• MSTest
• Moq - Mocking framework
• NCover - for coverage
• MSBuild - for automation
• Dotcover - coverage from VS
• Unity - for dependency injection
This talk has a very long demo
Lean-Agile Development with SharePoint - Bill AyersSPC Adriatics
SharePoint gives us a great platform for developing sophisticated intranet portals and collaboration sites and many other workloads. But it can also be a challenge to use modern software development frameworks like Scrum and XP. Wouldn’t it be great if we could get all the benefits of Agile practices – faster development, predictable deliveries, better quality, less stress and happy stakeholders? In this session we will cover the definitions of Lean, Agile, Scrum, Kanban, XP, and TDD. Then we will look at the specific challenges around Agile SharePoint development and some development techniques to overcome these obstacles. This talk covers both project delivery and engineering. We’ll look at unit tests, integration tests, UI tests, continuous integration and, of course, test-driven development (TDD) with practical experiences from real-life Agile SharePoint projects.
This presentation will give you a fuller understanding of unit testing in Swift, its benefits, key characteristics, mocks and stubs, dependency injection, DI patters and common mistakes one may make throughout the process.
This presentation by Andrii Gavrysh, GlobalLogic expert, was delivered at GlobalLogic Lviv iOS TechTalk on November 16, 2016.
Learn more: https://www.globallogic.com/ua/gl_news/globallogic-lviv-ios-techtalk-summary
We are entering a world where everything must be done quicker. You must deliver code faster. You must deploy faster. How can you deliver and deploy faster without compromising your professionalism? How can you be sure you are delivering what your client has asked you?
In short, testing is the only way to be sure you’re delivering what someone asked you to. Often we use BDD Tools such as FitNesse which gained popularity over the recent years
There are a number of integration / BDD test tools out there that help you deliver a high quality software through tests. Its easy to pick up any tool from just their tutorials and start writing tests. But as I found out the hard way, this can quickly spiral into a state where the tests are giving you and your team hell and are worth less than the value the tests are delivering.
Using FitNesse and Junit as examples, I will share things that I have learnt working on large enterprise and vendor systems and help you avoid your own path to hell.
Olli-Pekka Puolitaival - Model-Based Testing for Integration Testing in Real ...TEST Huddle
EuroSTAR Software Testing Conference 2012 presentation on Model-Based Testing for Integration Testing in Real Production by Olli-Pekka Puolitaival. See more at: http://conference.eurostarsoftwaretesting.com/past-presentations/
КОСТЯНТИН НАТАЛУХА «Setup and run automated test framework for Android applic...QADay
Kyiv Quality Assurance Day 2021
КОСТЯНТИН НАТАЛУХА
«Setup and run automated test framework for Android application»
Відео з презентації https://drive.google.com/file/d/1G3wK3ckSQhsedA9680Y7XQ_ztHhwRhJH/
Слідкуйте за нами:
Телеграм: t.me/goqameetup
Linkedin: linkedin.com/company/goqa
Fb: https://www.facebook.com/goqaevent
Fb: https://www.facebook.com/qaday.org
Youtube: https://www.youtube.com/channel/UCOyIrmpVbtqUZyRLxd9BKzA
HTML5 is one of the hottest technologies around right now because HTML5 apps are beautiful, engaging, and can perform important and entertaining functions. With the wide range of devices and platforms to support, the promise of multi-platform support is appealing. But HTML5 apps present their own range of security issues. So, what do you do about security? How do you test HTML5 applications to ensure their security? Alexander Andelkovic works at Spotify where their streaming music player desktop client applications are all HTML5-based. Alexander explains how manual testers can get the most out of HTML5 app security testing and manifest of HTML5 apps. He covers these common security testing issues and more: cross-site scripting (script inclusion), privacy-related issues, data leakage, and permissions. Discover how, by being proactive, you can avoid having to search for security issues late in a development project.
Leandro Melendez - Switching Performance Left & RightNeotys_Partner
Since its beginning, the Performance Advisory Council aims to promote engagement between various experts from around the world, to create relevant, value-added content sharing between members. For Neotys, to strengthen our position as a thought leader in load & performance testing. During this event, 12 participants convened in Chamonix (France) exploring several topics on the minds of today’s performance tester such as DevOps, Shift Left/Right, Test Automation, Blockchain and Artificial Intelligence.
Learn about the benefits of writing unit tests. You will spend less time fixing bugs and you will get a better design for your software. Some of the questions answered are:
Why should I, as a developer, write tests?
How can I improve the software design by writing tests?
How can I save time, by spending time writing tests?
When should I write unit tests and when should I write system tests?
Technologies like Squarespace, Salesforce, WordPress, or WIX are extremely popular for those who want to create a working website without necessary developer knowledge. In this talk, I would explore how Salesforce uses Page Object Model patterns to test its Communities platform which is used to develop websites for Salesforce users.
Throughout the talk, we will explore how multi-frame platform can be directly mapped to POM for Selenium Webdriver, and how client side code is developed to support this pattern.
The importance and complexity of these test framework is that it needs to be applicable for both platform and produced websites.
Recording: https://youtu.be/6opoooLdonI
This talk was give at the South Shore .NET Users Group.
Unit Testing is now considered a required skill for developers. There are a ton of tools out there. However, there's nothing that shows you how to tie them all together to make your software fast, testable, and flexible. This talk will go over my toolset:
• MSTest
• Moq - Mocking framework
• NCover - for coverage
• MSBuild - for automation
• Dotcover - coverage from VS
• Unity - for dependency injection
This talk has a very long demo
Lean-Agile Development with SharePoint - Bill AyersSPC Adriatics
SharePoint gives us a great platform for developing sophisticated intranet portals and collaboration sites and many other workloads. But it can also be a challenge to use modern software development frameworks like Scrum and XP. Wouldn’t it be great if we could get all the benefits of Agile practices – faster development, predictable deliveries, better quality, less stress and happy stakeholders? In this session we will cover the definitions of Lean, Agile, Scrum, Kanban, XP, and TDD. Then we will look at the specific challenges around Agile SharePoint development and some development techniques to overcome these obstacles. This talk covers both project delivery and engineering. We’ll look at unit tests, integration tests, UI tests, continuous integration and, of course, test-driven development (TDD) with practical experiences from real-life Agile SharePoint projects.
A Day in the Life: Developer Enhancements with Visual Studio 2012Imaginet
The newest release of Visual Studio 2012 is rich with new tools that enhance standard developer activities. In this session, we’ll review and demonstrate some of these new features, such as Unit Testing, Code Reviews, Code Clones, and other developer tools.
Cloud and Network Transformation using DevOps methodology : Cisco Live 2015Vimal Suba
Content presented as part of Cisco Live 2015 in San Diego
Why DevOps and what it means to be a DevOps-Enabled Organization?
Recommendations on Toolchain, Metrics framework, best practices and tips to help you embark on your IT Organization on DevOps journey
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Iasi code camp 20 april 2013 marian chicu - database unit tests in the sql server world
1. [Database unit tests]
(in the SQL Server world)
[Marian Chicu]
[Centric IT Romania]
[20th of April 2013]
2. Who am I?
• Development DBA @ Centric IT Romania
• Previously at ThinSlices and Premium
Software
• Working experience with SQL Server 2000
-> 2008 R2
• http://dba.stackexchange.com/users/418/
• http://www.linkedin.com/in/marianchicu/
3. Agenda
• Definition of unit testing
• Test driven development concepts
• Who cares?
• Benefits of unit testing
• Cost of unit testing
• Choosing what to test
• Demo with code
• Q&A (optional)
4. What is unit testing?
“In computer programming, unit testing is a
method by which individual units of source
code are tested to determine if they are fit
for use.
Intuitively, one can view a unit as the
smallest testable part of an application.”
5. What is unit testing?
• Unit testing is a lot like going to the gym
11. XUnit Architecture
Test suites
A test suite is a set of tests that all share the
same fixture. The order of the tests shouldn't
matter.
12. XUnit Architecture
Test fixtures
A test fixture (also known as a test context)
is the set of preconditions or state needed to
run a test. The developer should set up a
known good state before the tests, and
return to the original state after the tests.
13. XUnit Architecture
Test execution
• Setup – prepare test data
• Body of test - Here we make all the tests
• Assertions - An assertion is a function that
verifies the behavior of the unit under test.
14. XUnit Architecture
Test execution
• Assertions - Failure of an assertion typically
throws an exception, aborting the execution
of the current test.
• Teardown - we should clean up our 'world'
to not disturb other tests or code
34. The cost $$
The time spent actually writing unit tests in
the first place.
The time spent fixing and updating unit tests.
The tendency to avoid improving and
refactoring code.
39. Test driven development
The test system should support the
developer, not the other way around.
A developer must be able to create a new
test in under 10 minutes.
40. Test driven development
The test suite should be capable of running
hundreds of tests in minutes (not hours).
41. What to test?
Complex queries need better documentation
Complex queries need possible rewrites
(performance tuning, anyone? )
44. SSIS Unit test runner
• A hidden gem
• XML based
•Complex modules are more difficult to change if the requirements have changed
45. Database unit testing tools
• tSQLt – “The Database Unit Testing
Framework for SQL Server” (.NET)
• DBTestUnit – “free database unit testing
framework for .NET – currently supporting
MS SQL, MySQL and Oracle.”
• T.S.T. the T-SQL Test Tool – a testing API
(TSQL)
46. References:
Alex Kuznetsov’s blog – SimpleTalk and
SQLBlog
The RedGate Guide to SQL Server Team
Based Development - Phil Factor & co
What is the #1 Benefit of TDD? - Gil
Zilberfeld
47. References:
XUnit – Martin Fowler
Verifying Database Code by Using Unit Tests
– MSDN
Database Unit Testing with Team Edition for
Database Professionals - MSDN
48. References:
PluralSight courses
• Visual Studio 2010 Database Projects
• Test First Development
• Unit Testing with MSTest
Selective Unit Testing – Costs and Benefits -
Steven Sanderson
Unit Testing Myths and Practices - Tom
Fischer (on SimpleTalk)
"Unit testing is a well-understood concept in application development, but the database community has not yet embraced the advantages and strategies of this approach."This is a quote from an older MSDN whitepaper (march 2007) regarding unit testing in the SQL Server world. 6 years later I've found the situation is pretty similar, with many developers that write database code not really using this helpful methodology.
I miss you all!- 10 years experience (SQL Server 2000 -> 2k8 R2);- I like to learn & share technical info in the SO world (mostly on DBA.StackExchange.com)- don't tell my employer ;))! I do it only from home, really really!!- I'd like to see a SQL Server user group started (even if only for beers together, socializing should be mandatory in our field, we're so few);- Also a general database professionals group would be nice;Personal info:- I like reading about science stuff, IT security, psychology (Dan Ariely, PsyBlog);- Playing games on my PlayStation, playing poker, going to ski, airsoft;- as my friends already know, don't really like driving :-);
You know it is good for you, all the arguments make sense, so you start working out. There's an initial rush, which is great, but after a few days you start to wonder if it is worth the trouble. You're taking an hour out of your day to change your clothes and run on a hamster wheel and you're not sure you're really gaining anything other than sore legs and arms.Then, after maybe one or two weeks, just as the soreness is going away, a Big Deadline begins approaching. You need to spend every waking hour trying to get "useful" work done, so you cut out extraneous stuff, like going to the gym. You fall out of the habit, and by the time Big Deadline is over, you're back to square one. If you manage to make it back to the gym at all, you feel just as sore as you were the first time you went.
You know it is good for you, all the arguments make sense, so you start working out. There's an initial rush, which is great, but after a few days you start to wonder if it is worth the trouble. You're taking an hour out of your day to change your clothes and run on a hamster wheel and you're not sure you're really gaining anything other than sore legs and arms.Then, after maybe one or two weeks, just as the soreness is going away, a Big Deadline begins approaching. You need to spend every waking hour trying to get "useful" work done, so you cut out extraneous stuff, like going to the gym. You fall out of the habit, and by the time Big Deadline is over, you're back to square one. If you manage to make it back to the gym at all, you feel just as sore as you were the first time you went.
There's a misperception that testing belongs solely in the domain of QA. Developers are coders, and can't write tests.It's very hard to determine the value of test code.
Management doesn't really understand what unit testing really is, or why it has real intrinsic value to them.Management tends to be more concerned with rapid product delivery, and (incorrectly) sees unit testing as counterproductive to that goal.There's a common misperception that management will have to spend money to do unit testing correctly, despite the fact that the tools are freely available. (There is, of course, the developer ramp up time to consider, but it's not really prohibitive.)
XUnit is the family name given to bunch of testing frameworks that have become widely known amongst software developers. The name is a derivation of JUnit the first of these to be widely known. Siblings -> CppUnit, Nunit.The real root SUnit: Smalltalk community, Kent Beck was a big fan of automated testing at the heart of software development.The focus was on making it easy for programmers to define the tests using their regular Smalltalk environment, and then to run either a subset or a full set of tests quickly. Kent and his followers would run unit tests after every change to the system going through a rapid edit and test cycle in the Smalltalk IDE.
This is were a set of unit tests start (Test a Search stored procedure) -> several tests that fulfill this idea.
Test suite = (setup + teardown for the whole package) + tests (including their setup and teardowns)
Setup + teardown for the UNIT TEST
The setup() and teardown() methods serve to initialize and clean up test fixtures.
The setup() and teardown() methods serve to initialize and clean up test fixtures.
- bright individuals that get a new technology very fast (new languages, new platforms, new tools are acquired immediately as they appear);- in constant change (evolve continuously) - very rarely, mostly in big corporations, we see individuals that stay on the same technology for decades;- very good at writing complex database code (reports, searches, financial calculations);- sometimes want to avoid writing SQL code, they want to use an ORM (which is cool, unless you debug a 2 page query);- really a job of "Jack of all trades" (languages HTML, JS, C#, VB, CSS, ORMs, platforms for logging, for build, for source control, ..etc);- SQL is only a tool in their large handbag of tools;- think in objects or in procedures, butnot all the times get the "set way of thinking";
- don't care much about configuration, settings (integration testing -> files needed, settings that are changing from server to server -> connection strings, etc);- connections strings are ok?- files for input and output are existing?- want to make sure that functionality doesn't change (replace some LINQ with pure SQL and make sure the result is the same) -> transfer .net unit tests in db unit tests;- same approach as for the app code: a dev that's used to write tests for his .net code, will likely want to do the same for the SQL code;- sentiment of insurance when all unit tests pass (want to extend that to the db code, too);- feel the database as part of the project, another layer that's close, not a different area altogether (we now have source control, projects, builds for the databases) - they might see the db code as just as close and familiar as .net code (as long as technologies are similar and only the language is different);
- only in big companies;- there's no pure DBA job (in 99% of cases): sysadmin, SQL development, reports, BI implementations (ETL, aggregations);- usually they consider themselves the owner of the environment (which is not true):- everyone is owning the project (from the business owner, to the developer, QA, DevOps, DBA)- they do have the highest privileges on the db servers (but mostly because it's required, not because it's a playground);- like stability, because changes usually break things (deploys not really tested, system upgrades that don't go as expected (SP installation that breaks MS build and kills the server)) - lots of horror story especially in a 24/7 environment;- ugly ducklings (bad communication, no time, lack of insight in the app architecture, few people for many teams/environments/servers);- grumpy (see upper reasons);
They do performance tuning (which means REWRITING a lot of code)most of them don't write SQL code for the application (but help review it or make it faster);When wearing the developer hat, they share the benefits;what fails in the db is seen as their responsibility (and it's false, because the DBA maintains the whole environment, not individual pieces of code), so they don’t mind another safety net;unit tests would add another layer of safety among many others (eyeballing, manual executions, load tests, unit tests, QA env, acceptance, production). This might alleviate future pain.
- Represent the end user in the application development flow.-They do manual tests, automation, functionality, documentation, sometimes even talk to the customer to get facts.- sometimes even write code (load tests, automation of simple tests)- they have a hard life (sometimes one tester serves many developers, many apps, many environments, many clients)- interested in stability of the app;-they are the first real verification layer between the app and the real world;
- unit tests are a kind of contract between the dev and the app code that the code is stable;- piece of mind that easy cases are caught (flaws in the logic, bad data for input/output, some unnecessary delays are avoided) - if there is enough coverage;- don't see a single unit test, but see the whole, if there is at least 50% code coverage (and it’s for the complex stuff), or some useful number, they are happy and sure the developer is covering his back for simple and obvious cases;- avoid unnecessary clicks for future :-);
run fast, and make a difference: without them making changes and troubleshooting are more difficult.
run fast, and make a difference: without them making changes and troubleshooting are more difficult.
Nobody likes to wait
Nobody likes to wait
Without them making changes and troubleshooting are more difficult.
How do you test a new procedure?@debug parameter -> generate prints all over (check the flow of the procedure)Take all parameters and make sample callsCheck if it works for general cases
How do you test a new procedure?@debug parameter -> generate prints all over (check the flow of the procedure)Take all parameters and make sample callsCheck if it works for general cases
Unit tests find problems early in the development cycle.In test-driven development (TDD), which is frequently used in both Extreme Programming and Scrum, unit tests are created before the code itself is written. When the tests pass, that code is considered complete. The same unit tests are run against that function frequently as the larger code base is developed either as the code is changed or via an automated process with the build. If the unit tests fail, it is considered to be a bug either in the changed code or the tests themselves. The unit tests then allow the location of the fault or failure to be easily traced. Since the unit tests alert the development team of the problem before handing the code off to testers or clients, it is still early in the development process.
Unit testing allows the programmer to refactor code at a later date, and make sure the module still works correctly (e.g., in regression testing). The procedure is to write test cases for all functionsand methods so that whenever a change causes a fault, it can be quickly identified and fixed.Readily available unit tests make it easy for the programmer to check whether a piece of code is still working properly.In continuous unit testing environments, through the inherent practice of sustained maintenance, unit tests will continue to accurately reflect the intended use of the executable and code in the face of any change. Depending upon established development practices and unit test coverage, up-to-the-second accuracy can be maintained.
Unit testing may reduce uncertainty in the units themselves and can be used in a bottom-up testing style approach. By testing the parts of a program first and then testing the sum of its parts, integration testing becomes much easier.An elaborate hierarchy of unit tests does not equal integration testing. Integration with peripheral units should be included in integration tests, but not in unit tests.Integration testing typically still relies heavily on humans testing manually; high-level or global-scope testing can be difficult to automate, such that manual testing often appears faster and cheaper
Unit testing provides a sort of living documentation of the system. Developers looking to learn what functionality is provided by a unit and how to use it can look at the unit tests to gain a basic understanding of the unit's API.Unit test cases embody characteristics that are critical to the success of the unit. These characteristics can indicate appropriate/inappropriate use of a unit as well as negative behaviors that are to be trapped by the unit. A unit test case, in and of itself, documents these critical characteristics, although many software development environments do not rely solely upon code to document the product in development.By contrast, ordinary narrative documentation is more susceptible to drifting from the implementation of the program and will thus become outdated (e.g., design changes, feature creep, relaxed practices in keeping documents up-to-date).
A few obvious costs spring to mind:The time spent actually writing unit tests in the first placeNeed to define a suite of testsNeed to find out what to test/when to testNeed to configure a test environment / test configurationSearch for seed dataSearch for configuration files
Myth: the idea that unit testing inevitably lowers the cost of application development rests on the reasonable assumption that fixing a bug as soon as possible saves money. Graphs such as the one below typically compare two application’s costs to support this claim. Each solid black line represents an application’s total cost over time.
Real reason: They do not factor in the financial repercussions of a delay in the delivery of today’s enterprise applications.An organization’s profitability - the cost associated with the consequences of writing tests.Time expended coding unit tests keeps other features un-built and idling on backlog. The process of implementing unit tests cannot be readily scaled up to prevent backlog because, for most organizations, there are only one or two folks possessing the domain knowledge to add new or enhanced features to a specific application. When these developers code unit tests they are not coding new stuff.
A few obvious costs spring to mind:- The time spent actually writing unit tests in the first place- The time spent fixing and updating unit tests, either because you’ve deliberately refactored interfaces between code units or the responsibilities distributed among them, or because tests broke unexpectedly when you made other changes- The tendency – either by you or your colleagues – to avoid improving and refactoring application code out of fear that it may break a load of unit tests and hence incur extra work
A few obvious costs spring to mind:The time spent actually writing unit tests in the first placeNeed to define a suite of testsNeed to find out what to test/when to testNeed to configure a test environment / test configurationSearch for seed dataSearch for configuration files
- The time spent fixing and updating unit tests, either because you’ve deliberately refactored interfaces between code units or the responsibilities distributed among them, or because tests broke unexpectedly when you made other changesREFACTORING!Fixing broken unit tests!
- The tendency – either by you or your colleagues – to avoid improving and refactoring application code out of fear that it may break a load of unit tests and hence incur extra work
It makes you think before you write code.Guilty! Make all kind of assumptions -> start to code -> find problems -> avoid or ask questions -> lots of emails/skype/meetings -> deliver something that’s not very clearly documented!
It makes you think before you write code.So repeat after me: TDD is Thinking-driven development.
It makes you think before you write code.Sure, all the benefits are there: structured incremental progress, good coverage, and confidence when refactoring.But over and over again, when I see people starting to think about their first test, it comes back to me: It’s the think-before-you-act thing.In a user session from a Israel developers group (Israeli Software Craftsmanship User Group), we did the kata for counting code lines (3 times with 3 different groups). And three times, almost at the beginning, questions came up: -What constitutes a line? - In what language are we writing? - Do we count blank lines? - Does an “if” block counts as one line, even if it spreads over four lines? - Does a line need to contain compiling code?And so on. All of these questions came up before the first test (empty string, zero lines) or immediately after it. This kind of thinking and discussion before writing the code is what makes quality code.So repeat after me: TDD is Thinking-driven development.
Doesn’t have to be too complex to setup and configure (you have to just set it and forget it).Some early Microsoft test systems took almost a day to prepare (install all tools, all modules, prepare and configure everything).Developers didn’t really want to use them.
Difficult to obtain in a database environment. DBs are big.Possible solutions:Test configuration in Visual Studio projects -> different destination databaseSmall set of data (not 100 GBs of a db for testing functionality);Specific seed data for important tables (maybe few MB);This leads us to the next 2 questions: what to test and what NOT to test?
1.A well written unit test works very well as such - it demonstrates how to run a module and shows the expected results;2. They need performance tuning more often, and when tuning we may have to completely rewrite a slow query, improving its performance while keeping its functionality intact.
1. And when we fix those bugs, we need to make sure that we haven't introduce other ones;2. Because usually any unit tests involving the database run much slower than unit testing C++ or C# code alone, we typically do not add as many unit tests as we wish - we must keep the overall time the test harness runs low, within acceptable limits. So keeping unit tests for trivial modules may be very counterproductive as our systems grows, as we get more and more unit tests, and as we begin to wait too much until all our tests complete.
If our code refers a non-existing table or database, the database engine will throw a clear to understand error message. If this error message does not get stored in the error log, we should improve error handling. To verify that the DDL in our version control is in sync with the real thing, we can use tools such as SQL Compare.However, explicitly testing database modifications is rarely feasible: typically testing database modifications runs too slow, and the tests are quite delicate - we usually need to maintain them if the database schema changes. Suppose, for example, that we have added one more column to a table. If our select stored procedure does not use this new column, all existing unit tests invoking it can run as is. Unit tests verifying modifications of this table, however, usually need to change - they need to either ignore this new column, or to include this new column in their expected results.
Reward the most talkative persons with:2 RedGate books2 packs of poker cards for Scrum estimationCDs of fine music from our sponsors