پوشش تست (Test Coverage) یک معیار است که نشان میدهد چه مقدار از کد شما توسط تستهای واحد (Unit Tests) بررسی میشود. این معیار به شما میگوید که چه درصدی از کد شما هنگام اجرای تستها اجرا شده است.
به زبان ساده:
- پوشش تست بالا به این معنی است که بخش زیادی از کد شما تست شده و این احتمال بروز باگها را کاهش میدهد.
- پوشش تست پایین به این معنی است که فقط بخش کوچکی از کد تست شده و این باعث افزایش خطر وجود باگهای کشفنشده میشود.
با این حال، ۱۰۰٪ پوشش تست همیشه به این معنی نیست که کد شما بدون مشکل است، اما نشانه خوبی است که بیشتر بخشهای کد شما بررسی شدهاند.
آستانه مناسب بودن پوشش تست معمولاً به شرایط و پروژه بستگی دارد.
اما بهطور کلی ۷۰٪ تا ۸۰٪: اغلب به عنوان یک آستانه مناسب در نظر گرفته میشود. در این سطح، بخش بزرگی از کد شما تست شده است و احتمال وجود باگهای پنهان کاهش مییابد.
بالای ۸۰٪: این سطح پوشش معمولاً برای پروژههایی با اهمیت بالا و کدهای حساس توصیه میشود. با این حال، رسیدن به ۱۰۰٪ پوشش همیشه ضروری نیست و در برخی موارد حتی ممکن است عملی نباشد.به خاطر داشته باشید که کیفیت تستها نیز مهم است. حتی اگر پوشش تست بالا باشد، اگر تستها بهدرستی طراحی نشده باشند، ممکن است همچنان باگهای مهمی در کد وجود داشته باشد.
نحوه تست پوشش در گولنگ:
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
به زبان ساده:
- پوشش تست بالا به این معنی است که بخش زیادی از کد شما تست شده و این احتمال بروز باگها را کاهش میدهد.
- پوشش تست پایین به این معنی است که فقط بخش کوچکی از کد تست شده و این باعث افزایش خطر وجود باگهای کشفنشده میشود.
با این حال، ۱۰۰٪ پوشش تست همیشه به این معنی نیست که کد شما بدون مشکل است، اما نشانه خوبی است که بیشتر بخشهای کد شما بررسی شدهاند.
آستانه مناسب بودن پوشش تست معمولاً به شرایط و پروژه بستگی دارد.
اما بهطور کلی ۷۰٪ تا ۸۰٪: اغلب به عنوان یک آستانه مناسب در نظر گرفته میشود. در این سطح، بخش بزرگی از کد شما تست شده است و احتمال وجود باگهای پنهان کاهش مییابد.
بالای ۸۰٪: این سطح پوشش معمولاً برای پروژههایی با اهمیت بالا و کدهای حساس توصیه میشود. با این حال، رسیدن به ۱۰۰٪ پوشش همیشه ضروری نیست و در برخی موارد حتی ممکن است عملی نباشد.به خاطر داشته باشید که کیفیت تستها نیز مهم است. حتی اگر پوشش تست بالا باشد، اگر تستها بهدرستی طراحی نشده باشند، ممکن است همچنان باگهای مهمی در کد وجود داشته باشد.
نحوه تست پوشش در گولنگ:
go test ./... -cover
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
#Algorithm
#leetcode75
110. Balanced Binary Tree
https://telegra.ph/110-Balanced-Binary-Tree-08-29
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
#leetcode75
110. Balanced Binary Tree
https://telegra.ph/110-Balanced-Binary-Tree-08-29
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
Telegraph
110. Balanced Binary Tree
بررسی ۷۵ الگوریتم اساسی در leetcode شماره ۱۱ هفته اول 110. Balanced Binary Tree مسئله: تشخیص درخت ارتفاع-موازنه (Height-Balanced Tree) فرض کنید یک درخت دودویی به شما داده شده است. بررسی کنید که آیا این درخت ارتفاع-موازنه (height-balanced) است یا خیر. درخت…
#Algorithm
#leetcode75
141. Linked List Cycle
https://telegra.ph/141-Linked-List-Cycle-08-30
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
#leetcode75
141. Linked List Cycle
https://telegra.ph/141-Linked-List-Cycle-08-30
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
Telegraph
141. Linked List Cycle
بررسی ۷۵ الگوریتم اساسی در leetcode شماره ۱۲ هفته اول مسئله: با فرض بر اینکه head سَر یک لیست پیوندی است، مشخص کنید که آیا این لیست پیوندی دارای دور (حلقه) است یا خیر. اگر گرهای در لیست پیوندی وجود داشته باشد که بتوان با دنبال کردن مداوم اشاره گر بعدی (next)…
New unique package
The standard library of Go 1.23 now includes the new unique package. The purpose behind this package is to enable the canonicalization of comparable values. In other words, this package lets you deduplicate values so that they point to a single, canonical, unique copy, while efficiently managing the canonical copies under the hood. You might be familiar with this concept already, called “interning”. Let’s dive in to see how it works, and why it’s useful.
https://go.dev/blog/unique
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
The standard library of Go 1.23 now includes the new unique package. The purpose behind this package is to enable the canonicalization of comparable values. In other words, this package lets you deduplicate values so that they point to a single, canonical, unique copy, while efficiently managing the canonical copies under the hood. You might be familiar with this concept already, called “interning”. Let’s dive in to see how it works, and why it’s useful.
https://go.dev/blog/unique
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
go.dev
New unique package - The Go Programming Language
New package for interning in Go 1.23.
🎊 Go 1.23.1 and 1.22.7 are released!
🔐 Security: Includes security fixes for encoding/gob, go/build/constraint, and go/parser
🔈 Announcement: https://groups.google.com/g/golang-announce/c/K-cEzDeCtpc
📦 Download: go.dev/dl/#go1.23.1
➖➖➖➖➖➖➖➖
⚜ @GoInsights | @GolangEngineers
🔐 Security: Includes security fixes for encoding/gob, go/build/constraint, and go/parser
🔈 Announcement: https://groups.google.com/g/golang-announce/c/K-cEzDeCtpc
📦 Download: go.dev/dl/#go1.23.1
➖➖➖➖➖➖➖➖
⚜ @GoInsights | @GolangEngineers
در زیر یک cheatsheet خوب درخصوص authentication هستش و نکات خوبی برای پیاده سازی بخش user management ارائه داده که با رعایت موارد گفته شده امنیت سرویس خود را بهبود دهید.
https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html
➖➖➖➖➖➖➖➖
⚜ @GoInsights | @GolangEngineers
https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html
➖➖➖➖➖➖➖➖
⚜ @GoInsights | @GolangEngineers
آقا SSR با گولنگ را دریابید 😍😍
https://gtmetrix.com/reports/pacviewer.com/aAS0UYiE/
➖➖➖➖➖➖➖➖
⚜ @GoInsights | @GolangEngineers
https://gtmetrix.com/reports/pacviewer.com/aAS0UYiE/
➖➖➖➖➖➖➖➖
⚜ @GoInsights | @GolangEngineers
Go Developer Survey - September 2024
Hello! The Go Team wants to learn about your experiences working with Go. We'll use your feedback to improve existing tools and prioritize new features, with the goal of building a better experience for all Go developers. Once this survey has closed, we will publicly share de-identified and aggregated results with the Go community.
https://google.qualtrics.com/jfe/form/SV_ei0CDV2K9qQIsp8?s=b
➖➖➖➖➖➖➖➖
⚜ @GoInsights | @GolangEngineers
Hello! The Go Team wants to learn about your experiences working with Go. We'll use your feedback to improve existing tools and prioritize new features, with the goal of building a better experience for all Go developers. Once this survey has closed, we will publicly share de-identified and aggregated results with the Go community.
https://google.qualtrics.com/jfe/form/SV_ei0CDV2K9qQIsp8?s=b
➖➖➖➖➖➖➖➖
⚜ @GoInsights | @GolangEngineers
حق 🥹👌
➖➖➖➖➖➖➖➖
⚜ @GoInsights | @GolangEngineers
مورخ کامپیوتر، پاول ای. سروزی بعد از مرگ ریچی گفت: «ریچی زیر رادار بود. نامش اصلاً یک نام خانوادگی صرف نبود، اما … اگر میکروسکوپ میداشتید و میتوانستید درون یک کامپیوتر را نگاه کنید، میتوانستید کارش را در همه جای داخل آن ببینید.»
➖➖➖➖➖➖➖➖
⚜ @GoInsights | @GolangEngineers
What's in an (Alias) Name?
Robert Griesemer
17 September 2024
This post is about generic alias types, what they are, and why we need them.
https://go.dev/blog/alias-names
➖➖➖➖➖➖➖➖
⚜ @GoInsights | @GolangEngineers
Robert Griesemer
17 September 2024
This post is about generic alias types, what they are, and why we need them.
https://go.dev/blog/alias-names
➖➖➖➖➖➖➖➖
⚜ @GoInsights | @GolangEngineers
go.dev
What's in an (Alias) Name? - The Go Programming Language
A denoscription of generic alias types, a planned feature for Go 1.24
A Crash Course on Microservices Design Patterns.pdf
3.8 MB
A Crash Course on Microservices Design Patterns
#bytebytego #tips #pro_guide
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
#bytebytego #tips #pro_guide
➖➖➖➖➖➖➖➖
Please open Telegram to view this post
VIEW IN TELEGRAM
خلاصه حواستون باشه که آفر میگیرید میرید اونور و زن هم از اونجا میگیرید اگر با همسرتون اومدید ایران پیش خانواده اتون برنامه گوسفند رو بیخیال شید 😂😂
#fun
➖ ➖ ➖ ➖ ➖ ➖ ➖
☄️ @GoInsights | @GolangEngineers
#fun
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM