Every year we hear great content about how to develop in Go, but rarely do we focus on how to test in Go. Well written tests are critical to the success of a project, and more often than not, they can help drive developers to design features in more simple and concise ways.
In this talk, I'll explain the importance of test driven development and provide some tactics for how to implement the practice in your daily work and on your respective team. I'll dive into the testing, require, and assert packages to dissect which function calls are appropriate for different use cases, and present multiple different ways to write Go tests for each scope, including unit, integration and e2e. I'll also discuss how to refactor code to make it more testable (with examples), so you can optimize and simplify Go code for robust and reliable Go tests. Lastly, I will cover race conditions to help you debug concurrency related problems. Let's write Go(od) tests!
The Golang standard library provides a lot of examples of code design practices and patterns which allow us to create great things. However in practice engineers often ignore them.
I`m going to tell the story about one little library: the way from write-to-work stage to the idiomatic go implementation.
Greyhound - Powerful Pure Functional Kafka Library - Scala Love in the CityNatan Silnitsky
Wix has finally released to open-source its Kafka client SDK wrapper called Greyhound.
Completely re-written using the Scala functional library ZIO.
Greyhound harnesses ZIO's sophisticated async and concurrency features together with its easy composability to provide a superior experience to Kafka's own client SDKs.
It offers rich functionality including:
- Trivial setup of message processing parallelisation,
- Various fault tolerant retry policies (for consumers AND producers),
- Easy plug-ability of metrics publishing and context propagation and much more.
This talk will also show how Greyhound is used by Wix developers in more than 1500 event-driven microservices.
1. what is the different unbuffered and buffered channel?
2. how to implement a job queue in golang?
3. how to stop the worker in a container?
4. Shutdown with Sigterm Handling
5. Canceling Workers without Context
6. Graceful shutdown with worker
7. How to auto-scaling build agent?
8. How to cancel the current Job?
Better Open Source Enterprise C++ Web ServicesWSO2
In this webinar/presentation presented on November 10, 2009, Nandika Jayawardana explores the capabilities of the WSO2 Web Services Framework for C++ (WSO2 WSF/C++) to develop and deploy Web services in C++.
The Golang standard library provides a lot of examples of code design practices and patterns which allow us to create great things. However in practice engineers often ignore them.
I`m going to tell the story about one little library: the way from write-to-work stage to the idiomatic go implementation.
Greyhound - Powerful Pure Functional Kafka Library - Scala Love in the CityNatan Silnitsky
Wix has finally released to open-source its Kafka client SDK wrapper called Greyhound.
Completely re-written using the Scala functional library ZIO.
Greyhound harnesses ZIO's sophisticated async and concurrency features together with its easy composability to provide a superior experience to Kafka's own client SDKs.
It offers rich functionality including:
- Trivial setup of message processing parallelisation,
- Various fault tolerant retry policies (for consumers AND producers),
- Easy plug-ability of metrics publishing and context propagation and much more.
This talk will also show how Greyhound is used by Wix developers in more than 1500 event-driven microservices.
1. what is the different unbuffered and buffered channel?
2. how to implement a job queue in golang?
3. how to stop the worker in a container?
4. Shutdown with Sigterm Handling
5. Canceling Workers without Context
6. Graceful shutdown with worker
7. How to auto-scaling build agent?
8. How to cancel the current Job?
Better Open Source Enterprise C++ Web ServicesWSO2
In this webinar/presentation presented on November 10, 2009, Nandika Jayawardana explores the capabilities of the WSO2 Web Services Framework for C++ (WSO2 WSF/C++) to develop and deploy Web services in C++.
In May 2016, German game-development company Crytek made the, decision to upload the source code of their game engine, 'CryEngine V' to GitHub. The project is in active development, which leads to a large number of errors in the code. We have already checked the project with PVS-Studio for Windows, and now we can also analyze it using PVS-Studio for Linux. There was enough material for an article with the description of only crucial errors.
Event-sourced architectures with Akka - Sander MakNLJUG
Different JVM languages lead to different architectural styles. We all know the typical three-tiered architecture and its limitations. Akka and Scala offer event-sourcing. Event-sourced apps model all state changes explicitly and store them immutably. The actor model makes this horizontally scalable. Even better are the functional benefits: a provably correct auditlog and creating new views on past data. This session introduces the event-sourcing concepts. You’ll see how well they map onto actors. To prove this, we show an event-sourced application using Akka. The new Akka Persistence module provides excellent building blocks. Want to learn about the next generation of scalable architectures on the JVM? Check out event-sourcing with Akka!
Presented at GOTO Amsterdam (2017-06-13)
Video available at https://www.youtube.com/watch?v=YyhfK-aBo-Y
What is risk? Many people aren't sure, but it's not just uncertainty: risk is exposure to uncertainty.
Instead of just plastering over the cracks, security should also involve reducing the size and number of cracks, reducing the opportunities for cracks to appear, reducing the class of errors and oversights that can open a system to failure instigated from the outside. We can learn a lot from other kinds of software failure, because every failure unrelated to security can be easily reframed as a security-failure opportunity.
This is not a talk about access control models, authentication, encryption standards, firewalls, etc. This is a talk about reducing risk that lives in the code and the assumptions of architecture, reducing the risk in development practices and in the blind spot of development practices.
InterConnect: Server Side Swift for Java DevelopersChris Bailey
The range of languages and frameworks that are available for building server applications has exploded over the last few years, with the most recent of these being the Swift programming language, which IBM has been backing along with the Kitura application framework. But does this mean that Swift is the future and you should stop developing Java server applications? This session will give you an introduction to where and when you might use Kitura, and take you through the experiences of a long-time Java EE developer building their first Angular.js based Kitura application, and how that compares to building the same application with IBM WebSphere Liberty.
Slides for my talk event-sourced architectures with Akka. Discusses Akka Persistence as mechanism to do event-sourcing. Presented at Javaone 2014 and Jfokus 2015.
This talk was given at JSSummit 2013. Entitled "Avoiding Callback Hell with Async.js", my talk focused on common pitfalls with asynchronous functions and callbacks in JavaScript, and using the async.js library and its advanced control flows to create cleaner, more manageable code.
This slide deck (partly German) covers async and parallel programming topics for .NET and C#. For details see http://www.software-architects.com/devblog/2014/02/18/BASTA-2014-Spring-C-Workshop
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeKAI CHU CHUNG
Gokit is microservice tookit and use Service/Endpoint/Transport to strict separation of concerns design. This talk to use go-kit develop microservice application integrate with consul, zipkin, prometheus, etc service and deploy on Kubernetes.
In May 2016, German game-development company Crytek made the, decision to upload the source code of their game engine, 'CryEngine V' to GitHub. The project is in active development, which leads to a large number of errors in the code. We have already checked the project with PVS-Studio for Windows, and now we can also analyze it using PVS-Studio for Linux. There was enough material for an article with the description of only crucial errors.
Event-sourced architectures with Akka - Sander MakNLJUG
Different JVM languages lead to different architectural styles. We all know the typical three-tiered architecture and its limitations. Akka and Scala offer event-sourcing. Event-sourced apps model all state changes explicitly and store them immutably. The actor model makes this horizontally scalable. Even better are the functional benefits: a provably correct auditlog and creating new views on past data. This session introduces the event-sourcing concepts. You’ll see how well they map onto actors. To prove this, we show an event-sourced application using Akka. The new Akka Persistence module provides excellent building blocks. Want to learn about the next generation of scalable architectures on the JVM? Check out event-sourcing with Akka!
Presented at GOTO Amsterdam (2017-06-13)
Video available at https://www.youtube.com/watch?v=YyhfK-aBo-Y
What is risk? Many people aren't sure, but it's not just uncertainty: risk is exposure to uncertainty.
Instead of just plastering over the cracks, security should also involve reducing the size and number of cracks, reducing the opportunities for cracks to appear, reducing the class of errors and oversights that can open a system to failure instigated from the outside. We can learn a lot from other kinds of software failure, because every failure unrelated to security can be easily reframed as a security-failure opportunity.
This is not a talk about access control models, authentication, encryption standards, firewalls, etc. This is a talk about reducing risk that lives in the code and the assumptions of architecture, reducing the risk in development practices and in the blind spot of development practices.
InterConnect: Server Side Swift for Java DevelopersChris Bailey
The range of languages and frameworks that are available for building server applications has exploded over the last few years, with the most recent of these being the Swift programming language, which IBM has been backing along with the Kitura application framework. But does this mean that Swift is the future and you should stop developing Java server applications? This session will give you an introduction to where and when you might use Kitura, and take you through the experiences of a long-time Java EE developer building their first Angular.js based Kitura application, and how that compares to building the same application with IBM WebSphere Liberty.
Slides for my talk event-sourced architectures with Akka. Discusses Akka Persistence as mechanism to do event-sourcing. Presented at Javaone 2014 and Jfokus 2015.
This talk was given at JSSummit 2013. Entitled "Avoiding Callback Hell with Async.js", my talk focused on common pitfalls with asynchronous functions and callbacks in JavaScript, and using the async.js library and its advanced control flows to create cleaner, more manageable code.
This slide deck (partly German) covers async and parallel programming topics for .NET and C#. For details see http://www.software-architects.com/devblog/2014/02/18/BASTA-2014-Spring-C-Workshop
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeKAI CHU CHUNG
Gokit is microservice tookit and use Service/Endpoint/Transport to strict separation of concerns design. This talk to use go-kit develop microservice application integrate with consul, zipkin, prometheus, etc service and deploy on Kubernetes.
This is my presentation from TechBeats #3 hosted by Applause about Server-Side Swift framework called Vapor.
Swift is a great language and possibility of using it also in backend is a huge benefit for any iOS developer out there. Using Vapor is a seamless experience. With this framework creating advance APIs by iOS developer is as easy as writing simple iOS app.
https://www.meetup.com/TechBeats-hosted-by-Applause/events/254910023/
gRPC in Golang presentation
In this talk, I introduced gRPC, Protocol buffer, and how to use them with golang.
Source code used in the presentation: http://github.com/AlmogBaku/grpc-in-go
One of JavaScript’s strengths is how it handles asynchrony. Async is one of the most important and often misunderstood part of Javascript or any other language. We will see how dealing with asynchrony in JavaScript evolved over the years. It all started with callbacks, it landed on generators and...
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/254wkpw.
Aaron Bedra focuses on describing a system as a series of models that can be used to systematically and automatically generate input data and ensure that a code is behaving as expected. Bedra discusses property based testing and how it can help one build more resilient systems and even reduce the time needed to maintain a test suite. Filmed at qconlondon.com.
Aaron Bedra is Chief Security Officer at eligible.com. He is the creator of Repsheet, an open source threat intelligence framework. Bedra is the co-author of Programming Clojure, 2nd Edition and a frequent contributor to open source software.
Using c++Im also using a the ide editor called CodeLiteThe hea.pdffashiongallery1
Typed out please In a short and simple response comment on this persons answer for masonry
work Additives combined with concrete to achieve certain properties are called what? Name a
few that would benefit the Engineer and Customer.
Response - Additives to concrete are utilized to provide certain benefits when placing concrete.
These additives called \"Admixtures\" can be used to speed up the curing process, slow down the
curing process, or help in working with concrete during cold temperatures. Retarders can be
added to concrete to slow down curing. Accelerators can be used to speed up the curing. The
most advanced additive is the Air-entrainment agent which gives mason the ability to work with
concrete in colder months.
Typed out please In a short and simple response comment on this persons answer for masonry
work Additives combined with concrete to achieve certain properties are called what? Name a
few that would benefit the Engineer and Customer.
Response - Additives to concrete are utilized to provide certain benefits when placing concrete.
These additives called \"Admixtures\" can be used to speed up the curing process, slow down the
curing process, or help in working with concrete during cold temperatures. Retarders can be
added to concrete to slow down curing. Accelerators can be used to speed up the curing. The
most advanced additive is the Air-entrainment agent which gives mason the ability to work with
concrete in colder months.
Response - Additives to concrete are utilized to provide certain benefits when placing concrete.
These additives called \"Admixtures\" can be used to speed up the curing process, slow down the
curing process, or help in working with concrete during cold temperatures. Retarders can be
added to concrete to slow down curing. Accelerators can be used to speed up the curing. The
most advanced additive is the Air-entrainment agent which gives mason the ability to work with
concrete in colder months.
Solution
The response of the person is good. He/she explained the admixtures and their applications pretty
well and also explained accelators, retarders and air entertainment in a simple straight forward
fashion.Overall i would say that the answer is satisfactory.
I will like to add \"PLASTICIZERS\" in the list of admixtures that would benefit the engineer
and customer. Plasticizers are water reducing admixtures and are added to the concrete mix for
making it more plastic without any further addition of water. In other words, they reduce the
quantity of water required to make concrete mixture of better plasticity.
PLEASE HIT LIKE BUTTON IF YOU FIND MY ANSWER SATISFACTORY.
THANK YOU..
Let'Swift 2019 컨퍼런스에서 RxSwift to Combine 이라고 발표한 자료입니다. 자료 내에 언급되는 코드 링크는 다음과 같습니다.
[BringMyOwnBeer]
• RxSwift/RxCocoa: https://github.com/fimuxd/BringMyOwnBeer-
• Combine/SwiftUI: https://github.com/fimuxd/BringMyOwnBeer-Combine
Similar to Writing Go(od) Tests (FOSDEM 2020) (20)
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
Large Language Models (LLMs) are currently the center of attention in the tech world, particularly for their potential to advance research. In this presentation, we'll explore a straightforward and effective method for quickly initiating inference runs on supercomputers using the vLLM tool with Globus Compute, specifically on the Polaris system at ALCF. We'll begin by briefly discussing the popularity and applications of LLMs in various fields. Following this, we will introduce the vLLM tool, and explain how it integrates with Globus Compute to efficiently manage LLM operations on Polaris. Attendees will learn the practical aspects of setting up and remotely triggering LLMs from local machines, focusing on ease of use and efficiency. This talk is ideal for researchers and practitioners looking to leverage the power of LLMs in their work, offering a clear guide to harnessing supercomputing resources for quick and effective LLM inference.
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
How Recreation Management Software Can Streamline Your Operations.pptxwottaspaceseo
Recreation management software streamlines operations by automating key tasks such as scheduling, registration, and payment processing, reducing manual workload and errors. It provides centralized management of facilities, classes, and events, ensuring efficient resource allocation and facility usage. The software offers user-friendly online portals for easy access to bookings and program information, enhancing customer experience. Real-time reporting and data analytics deliver insights into attendance and preferences, aiding in strategic decision-making. Additionally, effective communication tools keep participants and staff informed with timely updates. Overall, recreation management software enhances efficiency, improves service delivery, and boosts customer satisfaction.
Accelerate Enterprise Software Engineering with PlatformlessWSO2
Key takeaways:
Challenges of building platforms and the benefits of platformless.
Key principles of platformless, including API-first, cloud-native middleware, platform engineering, and developer experience.
How Choreo enables the platformless experience.
How key concepts like application architecture, domain-driven design, zero trust, and cell-based architecture are inherently a part of Choreo.
Demo of an end-to-end app built and deployed on Choreo.
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
CyanicLab, an offshore custom software development company based in Sweden,India, Finland, is your go-to partner for startup development and innovative web design solutions. Our expert team specializes in crafting cutting-edge software tailored to meet the unique needs of startups and established enterprises alike. From conceptualization to execution, we offer comprehensive services including web and mobile app development, UI/UX design, and ongoing software maintenance. Ready to elevate your business? Contact CyanicLab today and let us propel your vision to success with our top-notch IT solutions.
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
The European Union Agency for Law Enforcement Cooperation (Europol) has suffered an alleged data breach after a notorious threat actor claimed to have exfiltrated data from its systems. Infamous data leaker IntelBroker posted on the even more infamous BreachForums hacking forum, saying that Europol suffered a data breach this month.
The alleged breach affected Europol agencies CCSE, EC3, Europol Platform for Experts, Law Enforcement Forum, and SIRIUS. Infiltration of these entities can disrupt ongoing investigations and compromise sensitive intelligence shared among international law enforcement agencies.
However, this is neither the first nor the last activity of IntekBroker. We have compiled for you what happened in the last few days. To track such hacker activities on dark web sources like hacker forums, private Telegram channels, and other hidden platforms where cyber threats often originate, you can check SOCRadar’s Dark Web News.
Stay Informed on Threat Actors’ Activity on the Dark Web with SOCRadar!
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Mind IT Systems
Healthcare providers often struggle with the complexities of chronic conditions and remote patient monitoring, as each patient requires personalized care and ongoing monitoring. Off-the-shelf solutions may not meet these diverse needs, leading to inefficiencies and gaps in care. It’s here, custom healthcare software offers a tailored solution, ensuring improved care and effectiveness.
A Comprehensive Look at Generative AI in Retail App Testing.pdfkalichargn70th171
Traditional software testing methods are being challenged in retail, where customer expectations and technological advancements continually shape the landscape. Enter generative AI—a transformative subset of artificial intelligence technologies poised to revolutionize software testing.
4. Why Golang?
● Statically and structurally typed
● Compiled language with large standard library
● Self-contained
● Concurrent and asynchronous
5. Why Golang?
● Statically and structurally typed
● Compiled language with large standard library
● Self-contained
● Concurrent and asynchronous
6. Why Golang?
● Statically and structurally typed
● Compiled language with large standard library
● Self-contained
● Concurrent and asynchronous
7. Why Golang?
● Statically and structurally typed
● Compiled language with large standard library
● Self-contained
● Concurrent and asynchronous
8. Why Golang?
● Statically and structurally typed
● Compiled language with large standard library
● Self-contained
● Concurrent and asynchronous
9. Testing implications
● Statically and structurally typed
● Compiled language with large standard library
● Self-contained
● Concurrent and asynchronous
10. Testing implications
● Statically and structurally typed
● Compiled language with large standard library
● Self-contained
● Concurrent and asynchronous
11. Testing implications
● Statically and structurally typed
● Compiled language with large standard library
● Self-contained
● Concurrent and asynchronous
12. Testing implications
● Statically and structurally typed
● Compiled language with large standard library
● Self-contained
● Concurrent and asynchronous
13. Testing implications
● Statically and structurally typed
● Compiled language with large standard library
● Self-contained
● Concurrent and asynchronous
21. run all tests in this directory:
go test
run a single test against a fully qualified package name:
go test -v -run TestSubtotal github.com/nikkixdev/beer/api
run all tests with tags, timeout, and race detector:
go test -tags=integration -race -timeout=60s -v -run ./...
run all tests with code coverage:
go test -cover
24. // Cart represents a shopping cart.
type Cart struct {
Cases []*Case
}
// Case represents a case of beer.
type Case struct {
Count int
Beer *Beer
Price float64
}
// Beer represents a type of beer.
type Beer struct {
Brand string
Name string
Ounces float64
}
// AddCase adds a case of beer to the
shopping cart.
func (c *Cart) AddCase(beerCase *Case) {
c.Cases = append(c.Cases, beerCase)
}
// FixtureBeer creates a Beer fixture for
use in test.
func FixtureBeer(brand string, name string,
ounces float64) *Beer {
return &Beer{
Brand: brand,
Name: name,
Ounces: ounces,
}
}
25. func TestAddCaseTesting(t *testing.T) {
cart := NewCart()
if len(cart.Cases) != 0 {
t.Fatal("expected empty cart")
}
blueLight := FixtureBeer("Labatt", "Blue Light", 12.0)
cart.AddCase(FixtureCase(6, blueLight, 10.99))
if len(cart.Cases) != 1 {
t.Fatal("expected 1 case in cart")
}
}
42. var (
background = new(emptyCtx)
todo = new(emptyCtx)
)
// Background returns a non-nil, empty Context. It is never canceled, has no
// values, and has no deadline. It is typically used by the main function,
// initialization, and tests, and as the top-level Context for incoming
// requests.
func Background() Context {
return background
}
// TODO returns a non-nil, empty Context. Code should use context.TODO when
// it's unclear which Context to use or it is not yet available (because the
// surrounding function has not yet been extended to accept a Context
// parameter).
func TODO() Context {
return todo
}
43. // Subscription represents a shopping cart.
type Subscription struct {
Cart *Cart
Interval time.Duration
messageChan chan interface{}
}
// startSubscriptionTimer starts a timer and fires the cart to the
// order handler when the order is ready.
func (s *Subscription) startSubscriptionTimer(ctx context.Context) {
ticker := time.NewTicker(s.Interval)
defer ticker.Stop()
for {
select {
case <-ctx.Done():
return
case <-ticker.C:
s.messageChan <- s.Cart
}
}
}